由于OWN_TASK_FAILURE HIVE,顶点未成功

时间:2020-02-26 12:49:10

标签: mysql hive hiveql

我正在尝试实现一个配置单元查询,该查询将尝试更新表中最近添加的记录的日期值。

我从这里获得了这段代码https://blog.cloudera.com/update-hive-tables-easy-way-2/

我正在尝试实施2类SDR。

这是我的桌子 enter image description here

enter image description here

enter image description here

下面是我正在运行的查询

merge into contacts_target
using (
  -- The base staging data.
  select
    contacts_update_stage.id as join_key,
    contacts_update_stage.* from contacts_update_stage

  union all

  -- Generate an extra row for changed records.
  -- The null join_key means it will be inserted.
  select
    null, contacts_update_stage.*
  from
    contacts_update_stage join contacts_target on contacts_update_stage.id = contacts_target.id
  where
    ( contacts_update_stage.email <> contacts_target.email or contacts_update_stage.name <> contacts_target.name )
    and contacts_target.valid_to is null
) sub
on sub.join_key = contacts_target.id
when matched
  and sub.email <> contacts_target.email or sub.name <> contacts_target.name
  then update set valid_to = current_date()
when not matched
  then insert values (sub.id, sub.name, sub.email, current_date(), null);

我一直在收到错误

由于OWN_TASK_FAILURE而导致顶点未成功,失败了任务:1终止了任务:0,顶点vertex_1582200340475_2730_40_08 [Reducer 5]由于以下原因而被终止/失败: failedVertices:1 KilledVertices:0(状态= 08S01,代码= 2)

我尝试了其他事情,例如使用左外部联接而不是合并,以为查询有问题,但尚未得到答案。

0 个答案:

没有答案
相关问题