Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-586

Create table with 'Char' data type but it workes as 'String' data type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 1.0.0-incubating
    • None
    • data-load
    • 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.

      Attachments

        Activity

          People

            qiangcai David Cai
            anuragknoldus Anurag Srivastava
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: