FALSE OR NULL 在 Hive 中不起作用
FALSE OR NULL doesn't work in Hive
根据 Hive language manual,FALSE OR NULL
应该评估为 NULL
,但我得到
FAILED: ClassCastException org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableVoidObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector
我可以使用 IF()
解决这个问题,但为什么这不起作用?
根据您所附的手册"FALSE OR NULL is NULL"不是 FALSE。
select a or b from (select cast (null as boolean) as a, false as b from test) x;
好的
_c0
空
其中 test 是一个虚拟 table。
根据 Hive language manual,FALSE OR NULL
应该评估为 NULL
,但我得到
FAILED: ClassCastException org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableVoidObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.primitive.BooleanObjectInspector
我可以使用 IF()
解决这个问题,但为什么这不起作用?
根据您所附的手册"FALSE OR NULL is NULL"不是 FALSE。
select a or b from (select cast (null as boolean) as a, false as b from test) x;
好的
_c0
空
其中 test 是一个虚拟 table。