You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Zoltan Haindrich (Jira)" <ji...@apache.org> on 2021/08/05 11:21:00 UTC
[jira] [Assigned] (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 ]
Zoltan Haindrich reassigned HIVE-25404:
---------------------------------------
Assignee: Zoltan Haindrich
> 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
>
> {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)