/[Apache-SVN]
ViewVC logotype

Revision 1752990


Jump to revision: Previous Next
Author: bpendleton
Date: Sat Jul 16 18:44:43 2016 UTC (7 years, 8 months ago)
Changed paths: 6
Log Message:
DERBY-4555: Expand SYSCS_IMPORT_TABLE to accept CSV file with header lines
DERBY-6894: Enhance COLUMNINDEXES parsing for SYSCS_IMPORT_DATA

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:

    1,3,"LastName","FirstName",7

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.


Changed paths

Path Details
Directorydb/derby/code/trunk/java/engine/org/apache/derby/impl/load/ColumnInfo.java modified , text changed
Directorydb/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java modified , text changed
Directorydb/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportReadData.java modified , text changed
Directorydb/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml modified , text changed
Directorydb/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java modified , text changed
Directorydb/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ImportExportProcedureTest.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26