hive不支持合并功能

798qvoo8  于 2021-06-27  发布在  Hive
关注(0)|答案(1)|浏览(537)

试图将表中的值更新到另一个表中,这两个表都有相同的字段名,但值不同,查询必须在任何普通数据库上正常工作,但在这里它返回
编译语句时出错:失败:parseexception行1:0无法识别“merge”附近的输入到“final”

MERGE 
INTO FINAL 
USING FIRST_STAGE
ON IMSI = FIRST_STAGE.IMSI and Site = FIRST_STAGE.Site
WHEN MATCHED THEN UPDATE SET
  Min_Date = least(FIRST_STAGE.Min_Date, Min_Date),
  Max_Date = greatest(FIRST_STAGE.Max_Date, Max_Date),
  NoofDays = FIRST_STAGE.NoofDays + NoofDays,
  Down_Link = FIRST_STAGE.Down_Link + Down_Link,
  up_Link = FIRST_STAGE.up_Link + up_Link,
  connection = FIRST_STAGE.connection + connection
WHEN NOT MATCHED THEN INSERT ( Min_Date, 
  Max_Date, 
  NoofDays, 
  IMSI, 
  Site, 
  Down_Link, 
  Up_Link, 
  Connection )
VALUES ( FIRST_STAGE.Min_Date, 
  FIRST_STAGE.Max_Date, 
  FIRST_STAGE.NoofDays, 
  FIRST_STAGE.IMSI, 
  FIRST_STAGE.Site, 
  FIRST_STAGE.Down_Link, 
  FIRST_STAGE.Up_Link, 
  FIRST_STAGE.Connection )
0dxa2lsx

0dxa2lsx1#

中引入了配置单元合并语句 Hortonworks distribution .
这些的先决条件 merge statement 要运行的是:
最终表格需要用 transactional enabled ,ORC format ,and bucketed .
afaik以防 Cloudera distribution 我们需要使用 Kuducloudera-5.10+ .
注: Upsert statement only works for Impala tables that use the Kudu storage engine. 我不认为我们可以运行中的帖子中提到的合并语句 CDH 到现在为止。

相关问题