You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/08/06 13:21:00 UTC
[jira] [Updated] (HIVE-25404) Inserts inside merge statements are
rewritten incorrectly for partitioned tables
[ https://issues.apache.org/jira/browse/HIVE-25404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HIVE-25404:
----------------------------------
Labels: pull-request-available (was: )
> Inserts inside merge statements are rewritten incorrectly for partitioned tables
> --------------------------------------------------------------------------------
>
> Key: HIVE-25404
> URL: https://issues.apache.org/jira/browse/HIVE-25404
> Project: Hive
> Issue Type: Bug
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {code}
> drop table u;drop table t;
> create table t(value string default 'def') partitioned by (id integer);
> create table u(id integer);
> {code}
> #1 id&value specified
> rewritten
> {code}
> FROM
> `default`.`t`
> RIGHT OUTER JOIN
> `default`.`u`
> ON `t`.`id`=`u`.`id`
> INSERT INTO `default`.`t` (`id`,`value`) partition (`id`) -- insert clause
> SELECT `u`.`id`,'x'
> WHERE `t`.`id` IS NULL
> {code}
> #2 when values is not specified
> {code}
> merge into t using u on t.id=u.id when not matched then insert (id) values (u.id);
> {code}
> rewritten query:
> {code}
> FROM
> `default`.`t`
> RIGHT OUTER JOIN
> `default`.`u`
> ON `t`.`id`=`u`.`id`
> INSERT INTO `default`.`t` (`id`) partition (`id`) -- insert clause
> SELECT `u`.`id`
> WHERE `t`.`id` IS NULL
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)