sql - How to convert TIMESTAMPS formats to be compatible with Impala -
here sample of data in csv format:
6/30/2014 23:57,2006,604,131 7/1/2014 0:24,2217,263,143 6/30/2014 23:26,173,3481,134 ...
i load csv file in impala table , have first column "timestamp":
create table my_table(col1 timestamp, col2 int, col3 int, col4 int) row format delimited fields terminated ','; load data inpath '/dataset/data' table my_table;
but impala accepts timestamps following format:
yyyy-mm-dd hh:mm:ss.sssssssss
while data is:
mm/dd/yyyy hh:mm
how can convert data in fastest way readable impala timestamps? trying use regexp_replace
not quite successful make regular expression.
the from_unixtime(unix_timestamp( timestamp, 'input_format' )) solution work hive, but, whatever reason, not work impala. consider bug , recommend submit cloudera.
Comments
Post a Comment