You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "苏锦佩 (JIRA)" <ji...@apache.org> on 2019/07/26 10:09:00 UTC

[jira] [Resolved] (TRAFODION-3307) emptyasempty option in map file not work

     [ https://issues.apache.org/jira/browse/TRAFODION-3307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

苏锦佩 resolved TRAFODION-3307.
----------------------------
    Resolution: Fixed

> 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: 40m
>  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.14#76016)