Hi Community,

I have a create a table in hive and same in CarbonData, In my CSV there is
whitespace after the data which is working fine in hive table whereas it
shows null in CarbonData table.

*In Hive*

1: Table created in Hive

create table my_user(id int, name string, address1 string, address2
string,salary double, incentive int)ROW FORMAT DELIMITED FIELDS TERMINATED
BY ",";

2: Load Data in table

LOAD DATA LOCAL INPATH '/home/vinod/Downloads/my_user2.csv' OVERWRITE INTO
TABLE my_user;

3: Select Query on hive

0: jdbc:hive2://localhost:10000> select * from my_user;
+-----+-----------+-----------+-----------+----------+------------+--+
| id  |   name    | address1  | address2  |  salary  | incentive  |
+-----+-----------+-----------+-----------+----------+------------+--+
| 1   | 'katy'    | 'london'  | 'UK'      | 5000.0   | 5000       |
| 2   | 'John'    | 'goa'     | 'goa'     | 12000.0  | 500        |
| 3   | 'Rachel'  | 'goa'     | 'goa'     | 10000.0  | 1000       |
+-----+-----------+-----------+-----------+----------+------------+--+
3 rows selected (0.122 seconds)

*In Carbon*

1: Create Table in Carbon 

create table my_user_c(id int, name string, address1 string, address2
string,salary double, incentive int) stored by 'carbondata';

2: Load Data in table

load data inpath 'hdfs://localhost:54310/my_user2.csv' into table my_user_c;

3: Select Query on carbon

0: jdbc:hive2://localhost:10000> select * from my_user_c;
+-----+-----------+-----------+-----------+----------+------------+--+
| id  |   name    | address1  | address2  |  salary  | incentive  |
+-----+-----------+-----------+-----------+----------+------------+--+
| 2   | 'John'    | 'goa'     | 'goa'     | 12000.0  | 500        |
| 3   | 'Rachel'  | 'goa'     | 'goa'     | 10000.0  | NULL      |
| 1   | 'katy'    | 'london'  | 'UK'      | 5000.0   | 5000       |
+-----+-----------+-----------+-----------+----------+------------+--+
3 rows selected (0.193 seconds)


it should display 1000 instead of NULL value in CarbonData.




--
View this message in context: 
http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/White-Space-does-not-trim-in-CarbonData-tp12736.html
Sent from the Apache CarbonData Dev Mailing List archive mailing list archive 
at Nabble.com.

Reply via email to