How to create an external Hive table with column typed Timestamp

后端 未结 1 1713
滥情空心
滥情空心 2021-01-03 15:12

I want to create an external Hive table from a text file containing epoch in HDFS. Let\'s say the file is located at the /user/me/test.txt. Here\'s the file con

相关标签:
1条回答
  • 2021-01-03 15:42

    The Timestamp string must be in the format specified in the error message and link, yyyy-mm-dd hh:mm:ss[.fffffffff]. To use data that contains epoch, you would have to define as a BIGINT and then use the built-in UDF, from_unixtime() to convert to a string representing the date. Then you could use the other built-in UDF date functions to manipulate this date.

    0 讨论(0)
提交回复
热议问题