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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -