[MCOL-2229] overwrite loadName in xml file with -l parameter Created: 2019-03-11  Updated: 2020-08-25  Resolved: 2019-04-29

Status: Closed
Project: MariaDB ColumnStore
Component/s: cpimport
Affects Version/s: 1.2
Fix Version/s: 1.2.3

Type: New Feature Priority: Major
Reporter: Richard Stracke Assignee: Richard Stracke
Resolution: Won't Do Votes: 0
Labels: None


 Description   

If a xml given with -p parameter and I add the option for -l (specify load file name)
the error message occur:

"No table name specified with schema."

In the sourcecode I found the following rule with the matching error message:

// Get positional arguments, User can provide:
    // 1. no positional parameters	- Mode 0 & stdin
    // 2. Two positional parameters (schema and table names) - Mode 1/2, stdin
    // 3. Three positional parameters (schema, table, and import file name)

It should be possible to specify a load file with -l,
which simply overwrite the load name specified with the -p option.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2019-03-29 ]

It cannot be implemented this way because you can have multiple tables and CSV files in the same XML file. I am open to suggestions but I can't think of any that wouldn't be difficult to implement for little gain or wouldn't have undefined behaviour.

Comment by Richard Stracke [ 2019-04-18 ]

LinuxJedi

Benefit is clear.
You can load a table with custom defined columns without creating a job for every load.

Most of the cases xml files include only 1 table.

So, if only 1 table is included, so it can overwritten if
count(//Table) =1

Elsewhere -p parameter can include 2 optional parameter.
-p colxml <optional tablename> <optional schemaname>

If optional table schema name used, only the first match will be used, other will be ignored.

Comment by Andrew Hutchings (Inactive) [ 2019-04-18 ]

I would argue that in many cases it is used for loading multiple tables (and even multiple XML files). This either becomes complex to implement due to having to add an initial pre-parse stage or we have it do bad things in a common use case.

A "sed" command would do the same thing as this requested feature and could easily be wrapped up into a shell script along with cpimport.

Comment by Todd Stoffel (Inactive) [ 2019-04-29 ]

Cannot be implemented as suggested. The -p and -l options cannot be used together.

Comment by Todd Stoffel (Inactive) [ 2019-04-29 ]

I have updated https://mariadb.com/kb/en/library/columnstore-bulk-data-loading/ to note the behavior.

Generated at Thu Feb 08 02:34:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.