db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danoja Dias (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6894) Enhance COLUMNINDEXES parsing for SYSCS_IMPORT_DATA_BULK to recognize columns by name
Date Sun, 03 Jul 2016 07:16:10 GMT

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

Danoja Dias commented on DERBY-6894:
------------------------------------

Hi Bryan,
No this while loop is not supposed to run more than once. Therefore it should be if condition
not a while loop. I will add the new patch with the tests.
All existing tests are clean. 
This is the list of cases that I came up with. Do you have any suggesions to include or exclude
tests?
I think we should add these tests to ImportExportProcedureTest.java

For a table like this
A(petName varchar(50),3 varchar(50) , age int)


1.) pass cases
Columns by name and indexes
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'1,2,\"AGE\"', 'pet.dat', null, null, null,0)

Columns by only names
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'\"PETNAME\",\"3\",\"AGE\"', 'pet.dat',
null, null, null,0)

Columns by only names and changing the order of columns
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'\"AGE\",\"PETNAME\",\"3\"', 'pet.dat',
null, null, null,0)

Only two columns out of four by name
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'\"PETNAME\",\"KINDOFANIMAL\"', 'pet.dat',
null, null, null,0)

2.) Fail cases
not giving capital letters.
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'\"petname\",\"3\",\"AGE\"', 'pet.dat',
null, null, null,0)

Give column name without '"' mark. Need to get the column named 3, but gets the index 3 column.
CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'A', null ,'3', 'pet.dat', null, null, null,0)

Thanks

> 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, noHeaderLines.csv, 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)

Mime
View raw message