[ 
https://issues.apache.org/jira/browse/CARBONDATA-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15831727#comment-15831727
 ] 

sounak chakraborty commented on CARBONDATA-610:
-----------------------------------------------

Date datatype will work in latest merge of 
https://github.com/apache/incubator-carbondata/pull/551. 

2 rows selected (0.28 seconds)
0: jdbc:hive2://localhost:10000> drop table uniqdata_date;
+---------+--+| Result  |
+---------+--+
+---------+--+
No rows selected (0.209 seconds)
0: jdbc:hive2://localhost:10000> CREATE TABLE uniqdata_date (CUST_ID 
int,CUST_NAME String,ACTIVE_EMUI_VERSION string, DOB date, DOJ date, 
BIGINT_COLUMN1 bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), 
DECIMAL_COLUMN2 decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 
double,INTEGER_COLUMN1 int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES ("TABLE_BLOCKSIZE"= "256 MB");
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.105 seconds)
0: jdbc:hive2://localhost:10000>   LOAD DATA INPATH 
'hdfs://localhost:54310/sc/2000_UniqData_date.csv' into table uniqdata_date 
OPTIONS('FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1');+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (1.372 seconds)
0: jdbc:hive2://localhost:10000> describe uniqdata_date;
+----------------------+-----------------+----------+--+|       col_name       
|    data_type    | comment  |
+----------------------+-----------------+----------+--+
| cust_id              | bigint          |          |
| cust_name            | string          |          |
| active_emui_version  | string          |          |
| dob                  | date            |          |
| doj                  | date            |          |
| bigint_column1       | bigint          |          |
| bigint_column2       | bigint          |          |
| decimal_column1      | decimal(30,10)  |          |
| decimal_column2      | decimal(36,10)  |          |
| double_column1       | double          |          |
| double_column2       | double          |          |
| integer_column1      | bigint          |          |
+----------------------+-----------------+----------+--+
12 rows selected (0.079 seconds)
0: jdbc:hive2://localhost:10000> select cust_name , dob,doj  from  
uniqdata_date;
+------------------+-------------+-------------+--+|    cust_name     |     dob 
    |     doj     |
+------------------+-------------+-------------+--+
| CUST_NAME_00001  | 1970-11-02  | 1970-11-02  |
| CUST_NAME_00002  | 1970-01-03  | 1970-01-03  |
| CUST_NAME_01999  | 1975-06-23  | 1975-06-23  |
+------------------+-------------+-------------+--+
3 rows selected (0.263 seconds)
0: jdbc:hive2://localhost:10000> update uniqdata_date set (dob)=('2016-12-11') 
where cust_name = 'CUST_NAME_00002';
+---------+--+| Result  |
+---------+--+
+---------+--+
No rows selected (0.903 seconds)
0: jdbc:hive2://localhost:10000> select cust_name , dob,doj  from  
uniqdata_date;
+------------------+-------------+-------------+--+
|    cust_name     |     dob     |     doj     |
+------------------+-------------+-------------+--+
| CUST_NAME_00001  | 1970-11-02  | 1970-11-02  |
| CUST_NAME_01999  | 1975-06-23  | 1975-06-23  |
| CUST_NAME_00002  | 2016-12-11  | 1970-01-03  |
+------------------+-------------+-------------+--+


> Update is working with String Datatype now but Date Datatype still not working
> ------------------------------------------------------------------------------
>
>                 Key: CARBONDATA-610
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-610
>             Project: CarbonData
>          Issue Type: Bug
>          Components: data-query
>    Affects Versions: 1.0.0-incubating
>         Environment: SPARK=1.6
>            Reporter: abhishek giri
>            Assignee: sounak chakraborty
>         Attachments: 3000_UniqData.csv, Screenshot from 2017-01-10 
> 12-32-48.png
>
>
> Update query is not working with spark 1.6 and String and date
> Create Table Query = CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
> String,ACTIVE_EMUI_VERSION string, DOB date, DOJ date, BIGINT_COLUMN1 
> bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
> decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
> int) STORED BY 'org.apache.carbondata.format' TBLPROPERTIES 
> ("TABLE_BLOCKSIZE"= "256 MB");
> Load data query = LOAD DATA INPATH 
> 'hdfs://localhost:54310/tmp/testData/3000_UniqData.csv' into table uniqdata 
> OPTIONS('FILEHEADER'='CUST_ID,CUST_NAME,ACTIVE_EMUI_VERSION,DOB,DOJ,BIGINT_COLUMN1,BIGINT_COLUMN2,DECIMAL_COLUMN1,DECIMAL_COLUMN2,Double_COLUMN1,Double_COLUMN2,INTEGER_COLUMN1');
>  
> Query for String = update uniqdata set (CUST_NAME)=('tony stark');
> Query for Date = update uniqdata set (dob)=('2016-12-11') where cust_name = 
> 'CUST_NAME_01999';
> After update NULL is being inserted as shown below: 
> ---------------------+-------------------------+----------------------+-----------------------+------------------+--+
> | cust_id  | cust_name  |    active_emui_version     |          dob           
> |          doj           | bigint_column1  | bigint_column2  |     
> decimal_column1     |     decimal_column2     |    double_column1    |    
> double_column2     | integer_column1  |
> +----------+------------+----------------------------+------------------------+------------------------+-----------------+-----------------+-------------------------+-------------------------+----------------------+-----------------------+------------------+--+
> | 10987    | NULL       | ACTIVE_EMUI_VERSION_01987  | 1975-06-11 01:00:03.0  
> | 1975-06-11 02:00:03.0  | 123372038841    | -223372034867   | 
> 12345.6808882656        | 22345.6808882656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1988             |
> | 10988    | NULL       | ACTIVE_EMUI_VERSION_01988  | 1975-06-12 01:00:03.0  
> | 1975-06-12 02:00:03.0  | 123372038842    | -223372034866   | 
> 12345.6808892656        | 22345.6808892656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1989             |
> | 10989    | NULL       | ACTIVE_EMUI_VERSION_01989  | 1975-06-13 01:00:03.0  
> | 1975-06-13 02:00:03.0  | 123372038843    | -223372034865   | 
> 12345.6808902656        | 22345.6808902656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1990             |
> | 10990    | NULL       | ACTIVE_EMUI_VERSION_01990  | 1975-06-14 01:00:03.0  
> | 1975-06-14 02:00:03.0  | 123372038844    | -223372034864   | 
> 12345.6808912656        | 22345.6808912656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1991             |
> | 10991    | NULL       | ACTIVE_EMUI_VERSION_01991  | 1975-06-15 01:00:03.0  
> | 1975-06-15 02:00:03.0  | 123372038845    | -223372034863   | 
> 12345.6808922656        | 22345.6808922656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1992             |
> | 10992    | NULL       | ACTIVE_EMUI_VERSION_01992  | 1975-06-16 01:00:03.0  
> | 1975-06-16 02:00:03.0  | 123372038846    | -223372034862   | 
> 12345.6808932656        | 22345.6808932656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1993             |
> | 10993    | NULL       | ACTIVE_EMUI_VERSION_01993  | 1975-06-17 01:00:03.0  
> | 1975-06-17 02:00:03.0  | 123372038847    | -223372034861   | 
> 12345.6808942656        | 22345.6808942656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1994             |
> | 10994    | NULL       | ACTIVE_EMUI_VERSION_01994  | 1975-06-18 01:00:03.0  
> | 1975-06-18 02:00:03.0  | 123372038848    | -223372034860   | 
> 12345.6808952656        | 22345.6808952656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1995             |
> | 10995    | NULL       | ACTIVE_EMUI_VERSION_01995  | 1975-06-19 01:00:03.0  
> | 1975-06-19 02:00:03.0  | 123372038849    | -223372034859   | 
> 12345.6808962656        | 22345.6808962656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1996             |
> | 10996    | NULL       | ACTIVE_EMUI_VERSION_01996  | 1975-06-20 01:00:03.0  
> | 1975-06-20 02:00:03.0  | 123372038850    | -223372034858   | 
> 12345.6808972656        | 22345.6808972656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1997             |
> | 10997    | NULL       | ACTIVE_EMUI_VERSION_01997  | 1975-06-21 01:00:03.0  
> | 1975-06-21 02:00:03.0  | 123372038851    | -223372034857   | 
> 12345.6808982656        | 22345.6808982656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1998             |
> | 10998    | NULL       | ACTIVE_EMUI_VERSION_01998  | 1975-06-22 01:00:03.0  
> | 1975-06-22 02:00:03.0  | 123372038852    | -223372034856   | 
> 12345.6808992656        | 22345.6808992656        | 1.12345674897976E10  | 
> -1.12345674897976E10  | 1999             |
> +----------+------------+----------------------------+------------------------+------------------------+-----------------+-----------------+-------------------------+-------------------------+----------------------+-----------------------+------------------+--+
> For Date snapshot is attached



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to