我在 hive 中有一张桌子:
# the description of table
desc baseinfo;
cv_id string None
cv_update string None
......
# data in table is like this
select cv_id, cv_update from baseinfo limit 1;
00001 2015-04-15 16:34:44
我想做的是这样的:
我想检查cv_update是否为Null,并且它应该满足格式要求,如下所示:
# is_format doesn't exist actually
SELECT cv_id, cv_update FROM baseinfo WHERE cv_update is NOT NULL AND cv_update.is_format("%Y-%m-%d %H:%M:%S")
最佳答案
好吧,这对我来说是一个更好的选择。
示例查询:
SELECT cv_id, cv_update
FROM baseinfo b
WHERE b.cv_update IS NOT NULL. and CAST(b.cv_update AS TIMESTAMP) IS NOT NULL.