Vandana Yadav created CARBONDATA-1143:
-----------------------------------------
Summary: Incorrect Data load while loading data into struct of struct
Key: CARBONDATA-1143
URL:
https://issues.apache.org/jira/browse/CARBONDATA-1143 Project: CarbonData
Issue Type: Bug
Components: data-load
Affects Versions: 1.2.0
Environment: spark 2.1
Reporter: Vandana Yadav
Priority: Minor
Attachments: structinstructnull.csv
Incorrect Data load while loading data into struct of struct
Steps to reproduce:
1) Create table:
create table structinstruct(id int, structelem struct<id1:int, structelem: struct<id2:int, name:string>>)stored by 'carbondata';
2)Load data:
load data inpath 'hdfs://localhost:54310/structinstructnull.csv' into table structinstruct options('delimiter'=',' , 'fileheader'='id,structelem','COMPLEX_DELIMITER_LEVEL_1'='#', 'COMPLEX_DELIMITER_LEVEL_2'='|');
3)Query executed:
select * from structinstruct;
4) Actual result:
+-------+------------------------------------------------------+--+
| id | structelem |
+-------+------------------------------------------------------+--+
| 1 | {"id1":111,"structelem":{"id2":1001,"name":"abc"}} |
| 2 | {"id1":222,"structelem":{"id2":2002,"name":"xyz"}} |
| NULL | {"id1":333,"structelem":{"id2":3003,"name":"def"}} |
| 4 | {"id1":null,"structelem":{"id2":4004,"name":"pqr"}} |
| 5 | {"id1":555,"structelem":{"id2":null,"name":"ghi"}} |
| 6 | {"id1":666,"structelem":{"id2":6006,"name":"null"}} |
| 7 | {"id1":null,"structelem":{"id2":1001,"name":null}} |
+-------+------------------------------------------------------+--+
7 rows selected (1.023 seconds)
5) Expected Result: In last row "id2" should be null as there is no such value(1001) provided in csv for that
6) Data in CSV:
1,111#1001|abc
2,222#2002|xyz
null,333#3003|def
4,null#4004|pqr
5,555#null|ghi
6,666#6006|null
7,null
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)