Hive create table 命令抛出 SemanticException 行 0:-1 无效函数 'IS NOT TRUE'
Hive create table command throwing SemanticException Line 0:-1 Invalid function 'IS NOT TRUE'
我的查询是这样的
create table abc as select * from (select x, (CASE WHEN ( y != '' and y is not null) THEN y ELSE z END ) AS testColumn from table1) q where q.testColumn is not null;
每当我运行这个。它给了我
SemanticException Line 0:-1 Invalid function 'IS NOT TRUE'
如果我从一开始就删除 create table 它会起作用,如果我将列名从 testColumn 更改为 x 它会起作用,如果我将 create table 更改为插入它会起作用。
创建 table 有什么问题?
提前致谢。
有多余的()
,估计是出错了。另外 y != '' and y is not null
是多余的,因为如果 y != ''
,它不能为 NULL,所以,y != ''
就足够了。
create table abc as
select *
from
(select x,
CASE WHEN y != '' THEN y ELSE z END AS testColumn
from table1
) q
where q.testColumn is not null;
我们的集群已经打过补丁,因此无法正常工作。
为了让它工作,我需要设置一个 属性
set hive.cbo.enable=false;
执行此操作后,我的查询成功了。
我的查询是这样的
create table abc as select * from (select x, (CASE WHEN ( y != '' and y is not null) THEN y ELSE z END ) AS testColumn from table1) q where q.testColumn is not null;
每当我运行这个。它给了我
SemanticException Line 0:-1 Invalid function 'IS NOT TRUE'
如果我从一开始就删除 create table 它会起作用,如果我将列名从 testColumn 更改为 x 它会起作用,如果我将 create table 更改为插入它会起作用。
创建 table 有什么问题?
提前致谢。
有多余的()
,估计是出错了。另外 y != '' and y is not null
是多余的,因为如果 y != ''
,它不能为 NULL,所以,y != ''
就足够了。
create table abc as
select *
from
(select x,
CASE WHEN y != '' THEN y ELSE z END AS testColumn
from table1
) q
where q.testColumn is not null;
我们的集群已经打过补丁,因此无法正常工作。 为了让它工作,我需要设置一个 属性
set hive.cbo.enable=false;
执行此操作后,我的查询成功了。