我正在尝试在SSIS 2015中使用Hadoop Hive Task运行Hive查询。我尝试运行的查询是:
create table if not exists table_a
as
select * from (
select
code,
md,
name,
region,
dingestdate,
max(dingestdate) over (partition by kode_maindealer) as dingestdate_latest
from dev_stg.stg_ahmsdnssls_xls_master_data_region
) as test1
where dingestdate = dingestdate_latest
此查询在Hue-Hive编辑器和Hive CLI中运行正常,但在SSIS中返回错误。错误消息:
[Hadoop Hive Task] Information: Hadoop job job_1561011012251_25231 exit value is 64
[Hadoop Hive Task] Error: Hadoop job job_1561011012251_25231 exit value is not 0
Task Hadoop Hive Task failed
有人用SSIS体验过吗?
我认为退出代码64表示您遇到语法错误。似乎已安装的Hive实例与SSIS中的Hadoop Hive任务支持的实例之间版本不匹配。
作为一种解决方法,我建议使用命令行(执行过程任务)运行配置单元脚本。
我已将查询分为两部分来解决了这个问题:
create table if not exists table_a (
code int,
md varchar(150),
name varchar(150),
region varchar(50),
dingestdate timestamp,
dingestdate_latest timestamp
)
row format delimited fields terminated by '|'
stored as parquet
tblproperties("parquet.compression"="gzip")
;
和
insert overwrite table table_a
select * from (
select
code,
md,
name,
region,
dingestdate,
max(dingestdate) over (partition by code) as dingestdate_latest
from table1 ) as test1 where dingestdate = dingestdate_latest
;
最后查询在SSIS中运行无误。
我也将在SSIS上尝试“执行流程任务”,以查看其是否也有效。
谢谢。