Hive unix_timestamp()返回NULL。
表中有一列,字段名为start_time,时间格式为 年-月-日 时:分:秒,
使用select unix_timestamp(start_time) from 表名时,返回NULL。
1、如果参数start_time满足yyyy-MM-dd HH:mm:ss形式,则可以直接unix_timestamp(start_time) 得到参数对应的时间戳
2、如果参数start_time不满足yyyy-MM-dd HH:mm:ss形式,则我们需要指定start_time的形式,再进行转换