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/12/08 15:34:00 UTC

[jira] [Work logged] (HIVE-21172) DEFAULT keyword handling in MERGE UPDATE clause issues

     [ https://issues.apache.org/jira/browse/HIVE-21172?focusedWorklogId=692674&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-692674 ]

ASF GitHub Bot logged work on HIVE-21172:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Dec/21 15:33
            Start Date: 08/Dec/21 15:33
    Worklog Time Spent: 10m 
      Work Description: kasakrisz opened a new pull request #2857:
URL: https://github.com/apache/hive/pull/2857


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   When generating the  insert part of an update clause of a merge statement replace the default keywords to the corresponding default values defined in default constraints.
   
   ### Why are the changes needed?
   To support splitting update clauses of merge statements into two insert branches: one for inserting new values and one for inserting into delete deltas. The first insert doesn't have to be sorted which can give a performance boost. See [HIVE-21158](https://issues.apache.org/jira/browse/HIVE-21158) and [HIVE-21159](https://issues.apache.org/jira/browse/HIVE-21159) for more details.
   When 'default' keyword is used the optimization can not be triggered because the compilation of the rewritten statement failed.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   ```
   mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=sqlmerge_stats.q -pl itests/qtest -Pitests
   ```


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 692674)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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: 10m
>  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)