db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-4555) Expand SYSCS_IMPORT_TABLE to accept CSV file with header lines
Date Sat, 18 Jun 2016 18:37:05 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Bryan Pendleton updated DERBY-4555:
    Attachment: repro.java

Thanks, the new diff applied just fine. You could probably delete the
partial attachment, and just leave the complete one.

I had no trouble building with the patch, and I was able to run the
'repro.java' program without problems, after I changed the program
to call the new procedure as:
   s.execute("CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE_SKIP_HEADER_LINES(null, 'A', 'noHeaderLines.csv',
',',null, null,0, 1)");

Is it possible that, when you encountered problems calling your
new procedure, perhaps you had a typo in the procedure's arguments?
I noticed that the new procedure takes 8 arguments, and in one version
of repro.java I was only passing 7 arguments, so I had to add the
missing argument to get repro.java to work.

I attached my copy of repro.java so you can try it by:
[bpendleton@Fedora22 DERBY-4555]$ javac -cp /home/bpendleton/derby/trunk/classes:. repro.java
[bpendleton@Fedora22 DERBY-4555]$ rm -rf derbyDB/ ;  java -cp /home/bpendleton/derby/trunk/classes:.

> Expand SYSCS_IMPORT_TABLE to accept CSV file with header lines
> --------------------------------------------------------------
>                 Key: DERBY-4555
>                 URL: https://issues.apache.org/jira/browse/DERBY-4555
>             Project: Derby
>          Issue Type: Improvement
>          Components: Miscellaneous
>            Reporter: Yair Lenga
>            Assignee: Danoja Dias
>         Attachments: NoVarargs.diff, Varargs.diff, addNewSystemProcedure.diff, addNewSystemProcedure_1.diff,
gotException.diff, hardCoded.diff, latest.diff, noHeaderLines.csv, petlist.csv, petlist.csv,
petlist.csv, repro.java, repro.java, repro.java, skipHeaders.diff
> The SYSCS_IMPORT_TABLE (and SYSCS_IMPORT_DATA) function allow import of data from external
resources. In general, they can process CSV files that created with various tools - with one
exception: the header line.
> While there is no accepted standard, most tools will include a header line in the CSV
file with column names. This convention is supported in Excel and many other tools.
> My Request: extend the SYSCS_IMPORT_TABLe and SYSCS_IMPORT_DATA (and other related procedures)
to include an extra indicator for the number of header lines to be ignored.
> As an extra bonus it will be help is the SYSCS_IMPORT_DATA will accept column names (instead
of column indexes) in the 'COLUMNINDEXES' arguments. E.g., it should be possible to indicate
COLUMNINDEXES of '1,3,sales,5,'. This feature will make it significantly easier to handle
cases where the external input files is extended to include additional columns.

This message was sent by Atlassian JIRA

View raw message