配置单元不支持合并功能

hive doesn't support merge function

尝试将值从 table 更新为另一个 table,这两个 table 具有相同的字段名称但不同的值,查询必须在任何正常的数据库,但在这里 returns

Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near 'MERGE' 'INTO' '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 )

Hive 合并语句Hortonworks distribution.

中引入
  • 这些 merge statement 到 运行 的先决条件是:

    最终 table 需要使用 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 发行版中的 post 中提到的那样合并语句。