I loaded the data with the timestamp field unsuccessful

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

I loaded the data with the timestamp field unsuccessful

kex
I loaded the data with the timestamp field unsuccessful,and timestamp field is null.

my sql:
carbon.sql("create TABLE IF NOT EXISTS test1 (date timestamp,id string) STORED BY 'carbondata' TBLPROPERTIES ('DICTIONARY_INCLUDE'='date','DATEFORMAT'='date:yyyy/MM/dd')")

carbon.sql("LOAD DATA inpath 'hdfs://myha/user/carbon/testdata/test4.csv' INTO TABLE test1 options('FILEHEADER'='date,id')")

my data test4.csv:
2017/3/23,2
2017/1/11,1
2017/9/17,3

when i select:
+----+---+
|date| id|
+----+---+
|null|  1|
|null|  2|
|null|  3|
+----+---+

i print time format is correct:
println(CarbonProperties.getInstance().getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT))
yyyy/MM/dd

What could be the reason for it?
thx.
Reply | Threaded
Open this post in threaded view
|

Re: I loaded the data with the timestamp field unsuccessful

David CaiQiang
try yyyy/M/dd

Best Regards
David CaiQiang
Best Regards
David Cai
Reply | Threaded
Open this post in threaded view
|

Re: I loaded the data with the timestamp field unsuccessful

Liang Chen
Administrator
In reply to this post by kex
Hi

If the issue has be fixed?
BTW, you don't need add date column to DICTIONARY_INCLUDE, it do index for date/timestamp columns.

Regards
Liang
kex wrote
I loaded the data with the timestamp field unsuccessful,and timestamp field is null.

my sql:
carbon.sql("create TABLE IF NOT EXISTS test1 (date timestamp,id string) STORED BY 'carbondata' TBLPROPERTIES ('DICTIONARY_INCLUDE'='date','DATEFORMAT'='date:yyyy/MM/dd')")

carbon.sql("LOAD DATA inpath 'hdfs://myha/user/carbon/testdata/test4.csv' INTO TABLE test1 options('FILEHEADER'='date,id')")

my data test4.csv:
2017/3/23,2
2017/1/11,1
2017/9/17,3

when i select:
+----+---+
|date| id|
+----+---+
|null|  1|
|null|  2|
|null|  3|
+----+---+

i print time format is correct:
println(CarbonProperties.getInstance().getProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT))
yyyy/MM/dd

What could be the reason for it?
thx.
kex
Reply | Threaded
Open this post in threaded view
|

Re: I loaded the data with the timestamp field unsuccessful

kex
This problem has been solved. I run the same sql to another cluster  is normal, may be the cluster of carbon.properties have problems.