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

Bryan Pendleton commented on DERBY-6894:
----------------------------------------


First, here are a few general comments:

- I think we should put our new test cases in a new method in
  ImportExportProcedureTest, not add them to the existing
  testImportExportProcedures() method.

  Perhaps we could call it "test6894ColumnIndexesParsing()"?

- Why don't we need to call "delete from pet" immediately after
  the initial call to SYSCS_EXPORT_TABLE? Why doesn't the first
  SYSCS_IMPORT_DATA_BULK result in a table with 9 total rows?

Next, here are some ideas for additional test cases to include in the suite.

Many of these should fail, and I'm interested in well we handle the error.
Some of these should succeed, but are probably unusual invocations.

Test cases for SYSCS_IMPORT_DATA_BULK:

- Specify skip == 0 and a non-existent input file
- Specify skip == 2 and a non-existent input file

- Specify skip == 0 and columnindexes == 1,2,"Age"

- Specify skip == 1 and columnindexes == 1,2,"Age"
- Specify skip == 1 and columnindexes == "Pet","Kind","Age"

- Specify skip == 7 and columnindexes == 1,2,3

- Specify skip == 3 and columnindexes == 1,2,"AGE"
- Specify skip == 3 and columnindexes == 1,"Kind   of  Animal","Age"

- Specify skip == 3 and columnindexes == 1,2,"  Age  "

- Specify skip == 3 and columnindexes == "Pet""Name","Kind"of"Animal","Age"

- Specify skip == 2 and columnindexes == "Pet Name","Kind of","Age"

- Specify skip == 4 and columnindexes == "Pet Name Rover",2,3
- Specify skip == 4 and columnindexes == 1,2,"Age 4"
- Specify skip == 4 and columnindexes == 1,"Kind of Animal Dog",3

- Specify skip == 3 and columnindexes = 1,2
- Specify skip == 3 and columnindexes = 1,"Kind of Animal"
- Specify skip == 3 and columnindexes = 1,"Age"

- Specify skip == -2
- Specify skip == -1

- Specify skip == 3, insertcolumns=c1,c2 and columnindexes=1,2
- Specify skip == 3, insertcolumns=c1,c2 and columnindexes=1,3
- Specify skip == 3, insertcolumns=c1,c3 and columnindexes=1,3
- Specify skip == 3, insertcolumns=c1,c2 and columnindexes="Pet Name", "Kind of 
Animal"

I think we should add some of the above test cases
for SYSCS_IMPORT_TABLE_BULK, as well:

- Specify skip == 0 and a non-existent input file
- Specify skip == 2 and a non-existent input file
- Specify skip == -1
- Specify skip == 7

Since COLUMNINDEXES is present in SYSCS_IMPORT_DATA and
SYSCS_IMPORT_DATA_LOBS_FROM_EXTFILE, we should include some
test cases for both of those procedures, such as:

- Specify columnindexes == 1,2,"Age"
- Specify columnindexes == 1,2,Age
- Specify columnindexes == 1,2,4
- Specify columnindexes == "Pet""Name","Kind"of"Animal","Age"
- Specify columnindexes == 1,2,3 and a non-existent input file

Lastly, since "performImport()" is invoked for several other
system procedures, I think we should add some additional
test cases for SYSCS_IMPORT_TABLE and for
SYSCS_IMPORT_TABLE_LOBS_FROM_EXTFILE:

- Specify a non-existent input file
- Specify a destination table with only two varchar columns
- Specify a destination table with 3 columns, but the second
  column is an INTEGER column

Perhaps, as you are working through some of these test
cases, additional test cases will occur to you. If so,
please add them as you think of them!

thanks,

bryan






> 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, NewDerby6894.diff, NewDerby6894_2.diff, 
> noHeaderLines.csv, petlist.csv, repro.java, 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
(v6.3.4#6332)

Reply via email to