Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
1.0.0-incubating
-
None
-
None
-
spark 1.6.2
spark 2.1
Description
I am trying to use Char data type with Carbon Data latest version and it created successfully. When I started loading data in this that time I found that it is taking data more then its size.
I have checked it with hive and there it is working fine.
EX :-
1. Carbon Data :
1.1 create table test_carbon (name char(10)) stored by 'org.apache.carbondata.format';
1.2 desc test_carbon;
Output :
---------------------------------+
col_name | data_type | comment |
-------------------------------------
name | string |
-------------------------------------
1.3 LOAD DATA INPATH 'hdfs://localhost:54310/test.csv' into table test_carbon OPTIONS ('FILEHEADER'='name');
1.4 select * from test_carbon;
Output :
------------------------
name |
------------------------
Anurag Srivasrata |
Robert |
james james |
------------------------
2. Hive :
2.1 create table test_hive (name char(10));
2.2 desc test_hive;
Output :
------------------------------------
col_name | data_type | comment |
------------------------------------
name | char(10) | NULL |
------------------------------------
2.3 LOAD DATA INPATH 'hdfs://localhost:54310/test.csv' into table test_hive;
2.4 select * from test_hive;
Output :
----------------
name |
----------------
james jame |
Anurag Sri |
Robert |
----------------
So as hive truncate remaining string with Char data type in carbon data it should work like hive.