[jira] [Created] (CARBONDATA-586) Create table with 'Char' data type but it workes as 'String' data type

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (CARBONDATA-586) Create table with 'Char' data type but it workes as 'String' data type

Akash R Nilugal (Jira)
Anurag Srivastava created CARBONDATA-586:
--------------------------------------------

             Summary: Create table with 'Char' data type but it workes as 'String' data type
                 Key: CARBONDATA-586
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-586
             Project: CarbonData
          Issue Type: Bug
          Components: data-load
    Affects Versions: 1.0.0-incubating
         Environment: Cluster
            Reporter: Anurag Srivastava
            Priority: Minor


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Created] (CARBONDATA-586) Create table with 'Char' data type but it workes as 'String' data type

kumarvishal09
Hi
Currently in carbon char is stored as string and there is not validation for the length of string.
-Regards
Kumar Vishal
kumar vishal