[ 
https://issues.apache.org/jira/browse/TRAFODION-3307?focusedWorklogId=233232&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-233232
 ]

ASF GitHub Bot logged work on TRAFODION-3307:
---------------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Apr/19 02:21
            Start Date: 26/Apr/19 02:21
    Worklog Time Spent: 10m 
      Work Description: SuJinpei commented on pull request #1838: fix 
TRAFODION-3307
URL: https://github.com/apache/trafodion/pull/1838
 
 
   change the null string and empty string handle logic as below:
   
   if empty string handle option defined in the map file then
       handle empty string as the map file defined rule
   else if ns option is set then
       handle empty string as an empty string
   else
      handle empty string as null
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 233232)
            Time Spent: 10m
    Remaining Estimate: 0h

> emptyasempty option in map file not work
> ----------------------------------------
>
>                 Key: TRAFODION-3307
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3307
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: db-utility-odb
>    Affects Versions: 2.4
>            Reporter: 苏锦佩
>            Priority: Major
>             Fix For: 2.4
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In odb, user can write a map to determine an empty string should be treated 
> as null or empty. However, this feature not work as expected.
> For example, I have a table, a map file and a data file as below(you can also 
> refer to attached file):
> >>>table:
> create table testemp(id int, c1 char(20) not null, c2 char(20));
> >>>map:
> ID:1
> C1:2:emptyasempty
> C2:3
> >>>data
> 1,,abc
> 2,,def
> Then run odb cmd to load the data, the expected result is all data should be 
> loaded, the atcual result is as below:
> odb.exe -d 14d4 -u trafodion -p traf123 -l 
> src=testdata.txt:tgt=testemp:map=testmap.txt
> odb [2019-04-18 16:15:17]: starting ODBC connection(s)... 0
> Connected to Trafodion
> [0] odb [Oloadbuff(10212)] - Error loading row 1 (State: 23000, Native 0)
> [TRAF][Trafodion ODBC Driver] General error. Null Value in a non nullable 
> column. Row: 1 Column: 2
> the emptyasempty option does not work as expected:
> odb.exe -d 14d4 -u trafodion -p traf123 -l 
> src=testdata.txt:tgt=testemp:map=testmap.txt:show
> odb [2019-04-18 16:16:18]: starting ODBC connection(s)... 0
> Connected to Trafodion
> Record number 1:
> COL# COLUMN_NAME ODBC_DATA_TYPE DISP_SZ DEC NULL FLD_LEN [FLD_VALUE]
>    0 ID SQL_INTEGER 11 0 YES 1 [1]
>    1 C1 SQL_CHAR 20 0 NO - [(null)]
>    2 C2 SQL_CHAR 20 0 YES 3 [abc]
> Record number 2:
> COL# COLUMN_NAME ODBC_DATA_TYPE DISP_SZ DEC NULL FLD_LEN [FLD_VALUE]
>    0 ID SQL_INTEGER 11 0 YES 1 [2]
>    1 C1 SQL_CHAR 20 0 NO - [(null)]
>    2 C2 SQL_CHAR 20 0 YES 3 [def]
> odb [2019-04-18 16:16:20]: exiting. Session Elapsed time 2.164 seconds 
> (00:00:02.164)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to