[ https://issues.apache.org/jira/browse/HIVE-21172?focusedWorklogId=696532&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-696532 ]
ASF GitHub Bot logged work on HIVE-21172: ----------------------------------------- Author: ASF GitHub Bot Created on: 15/Dec/21 11:12 Start Date: 15/Dec/21 11:12 Worklog Time Spent: 10m Work Description: kasakrisz commented on a change in pull request #2857: URL: https://github.com/apache/hive/pull/2857#discussion_r769526713 ########## File path: ql/src/test/results/clientpositive/llap/explain_locks.q.out ########## @@ -233,20 +221,14 @@ POSTHOOK: Input: default@target@p=2/q=2 POSTHOOK: Output: default@merge_tmp_table POSTHOOK: Output: default@target POSTHOOK: Output: default@target@p=1/q=2 -POSTHOOK: Output: default@target@p=1/q=2 -POSTHOOK: Output: default@target@p=1/q=3 POSTHOOK: Output: default@target@p=1/q=3 POSTHOOK: Output: default@target@p=2/q=2 -POSTHOOK: Output: default@target@p=2/q=2 LOCK INFORMATION: default.source -> SHARED_READ default.target.p=1/q=2 -> SHARED_READ default.target.p=1/q=3 -> SHARED_READ default.target.p=2/q=2 -> SHARED_READ default.target.p=2/q=2 -> SHARED_WRITE -default.target.p=2/q=2 -> SHARED_WRITE Review comment: If `hive.merge.split.update` is `false` the merge statement has three type of outputs: `insert`, `delete`, `update` the same partitioned table. `RewriteSemanticAnalyzer.updateOutputs()` adds the affected partitions twice: one set for `delete` and one for `update` https://github.com/apache/hive/blob/6f29c1acf04fa1f1b84a6fb86f92bdc65b584567/ql/src/java/org/apache/hadoop/hive/ql/parse/RewriteSemanticAnalyzer.java#L339 When `hive.merge.split.update` is `true` only `insert` and `delete` outputs are present so partitions are listed only once. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 696532) Time Spent: 1h (was: 50m) > DEFAULT keyword handling in MERGE UPDATE clause issues > ------------------------------------------------------ > > Key: HIVE-21172 > URL: https://issues.apache.org/jira/browse/HIVE-21172 > Project: Hive > Issue Type: Sub-task > Components: SQL, Transactions > Affects Versions: 4.0.0 > Reporter: Eugene Koifman > Assignee: Krisztian Kasa > Priority: Major > Labels: pull-request-available > Time Spent: 1h > Remaining Estimate: 0h > > once HIVE-21159 lands, enable {{HiveConf.MERGE_SPLIT_UPDATE}} and run these > tests. > TestMiniLlapLocalCliDriver.testCliDriver[sqlmerge_stats] > mvn test -Dtest=TestMiniLlapLocalCliDriver > -Dqfile=insert_into_default_keyword.q > Merge is rewritten as a multi-insert. When Update clause has DEFAULT, it's > not properly replaced with a value in the muli-insert - it's treated as a > literal > {noformat} > INSERT INTO `default`.`acidTable` -- update clause(insert part) > SELECT `t`.`key`, `DEFAULT`, `t`.`value` > WHERE `t`.`key` = `s`.`key` AND `s`.`key` > 3 AND NOT(`s`.`key` < 3) > {noformat} > See {{LOG.info("Going to reparse <" + originalQuery + "> as \n<" + > rewrittenQueryStr.toString() + ">");}} in hive.log > {{MergeSemanticAnalyzer.replaceDefaultKeywordForMerge()}} is only called in > {{handleInsert}} but not {{handleUpdate()}}. Why does issue only show up with > {{MERGE_SPLIT_UPDATE}}? > Once this is fixed, HiveConf.MERGE_SPLIT_UPDATE should be true by default -- This message was sent by Atlassian Jira (v8.20.1#820001)