我有一个Hive表如下:
incident_id string
incident_time timestamp
call_id string
call_time timestamp
我最初使用
cast(from_unixtime(unix_timestamp(incident_time, 'yyyy-MM-dd hh:mm:ss')) as timestamp) as incident_time
我做了一个快速选择,它们看起来都不错。我正在查找哪些记录的事件时间介于通话前1小时到通话后48小时之间。我的问题是:
select * from mydb.mytable where
(incident_time >= call_time-3600) and
(incident_time <= call_time+172800);
这会引发一个错误,失败时出现异常java.io.ioexception:java.lang.runtimeexception:配置单元2内部错误:不支持从类型转换:interval\u day\u time
1条答案
按热度按时间mlmc2os51#
我通过在hive中使用datediff函数来解决这个问题。
找到答案https://issues.apache.org/jira/browse/hive-12729