db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6894) Enhance COLUMNINDEXES parsing for SYSCS_IMPORT_DATA_BULK to recognize columns by name
Date Sat, 16 Jul 2016 18:45:20 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15380892#comment-15380892

ASF subversion and git services commented on DERBY-6894:

Commit 1752990 from [~bryanpendleton] in branch 'code/trunk'
[ https://svn.apache.org/r1752990 ]

DERBY-4555: Expand SYSCS_IMPORT_TABLE to accept CSV file with header lines

This patch was contributed by Danoja Dias (danojadias at gmail dot com)

The purpose of this patch is to allow the COLUMNINDEXES value to specify
columns in the input file by column header "name", as an alternate to
column index number. Column header names can be specified as double-quoted
strings, and you can mix-and-match indexes and names, so that
COLUMNINDEXES could be specified as:


During the preparation of the input file for import processing, the
new "readHeaders" method that is added to the Import class will,
if 'skip > 0', open the input file, read the first 'skip' number of lines,
parse the column structure, and construct an array of the column headers,
then close the input file and return the headers array.

Then, the COLUMNINDEXES value, if it contains any column names, rather
than column index numbers, is matched against the headers array to
determine which column(s) to use.

> Enhance COLUMNINDEXES parsing for SYSCS_IMPORT_DATA_BULK to recognize columns by name
> -------------------------------------------------------------------------------------
>                 Key: DERBY-6894
>                 URL: https://issues.apache.org/jira/browse/DERBY-6894
>             Project: Derby
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Bryan Pendleton
>            Assignee: Danoja Dias
>            Priority: Minor
>         Attachments: Derby-6894.diff, EndofLineError.diff, NewDerby6894.diff, NewDerby6894_2.diff,
NewDerby6894_3.diff, noHeaderLines.csv, petlist.csv, readHeadersLoadError.diff, repro.java,
> To ease maintainability and legibility of client programs, it would be
> nice if callers of SYSCS_IMPORT_DATA_BULK (and possibly also
> SYSCS_IMPORT_DATA) could refer to columns in the COLUMNINDEXES
> argument by column *NAME*, as well as by index *NUMBER*.
> So, for example, a valid COLUMNINDEXES specification might be:
>     '1,3,LastName,FirstName,7'

This message was sent by Atlassian JIRA

View raw message