[ https://issues.apache.org/jira/browse/HIVE-26997?focusedWorklogId=853229&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-853229 ]
ASF GitHub Bot logged work on HIVE-26997: ----------------------------------------- Author: ASF GitHub Bot Created on: 27/Mar/23 18:35 Start Date: 27/Mar/23 18:35 Worklog Time Spent: 10m Work Description: deniskuzZ opened a new pull request, #4162: URL: https://github.com/apache/hive/pull/4162 <!-- 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? <!-- Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below. 1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers. 2. If you fix some SQL features, you can provide some references of other DBMSes. 3. If there is design documentation, please add the link. 4. If there is a discussion in the mailing list, please add the link. --> Fixed non-vectorization cause ### Why are the changes needed? <!-- Please clarify why the changes are needed. For instance, 1. If you propose a new API, clarify the use case for a new API. 2. If you fix a bug, you can clarify why it is a bug. --> Performance ### Does this PR introduce _any_ user-facing change? <!-- Note that it means *any* user-facing change including all aspects such as the documentation fix. If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible. If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master. If no, write 'No'. --> ### How was this patch tested? <!-- If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future. If tests were not added, please describe why they were not added and/or why it was difficult to add. --> Issue Time Tracking ------------------- Worklog Id: (was: 853229) Time Spent: 50m (was: 40m) > Iceberg: Vectorization gets disabled at runtime in merge-into statements > ------------------------------------------------------------------------ > > Key: HIVE-26997 > URL: https://issues.apache.org/jira/browse/HIVE-26997 > Project: Hive > Issue Type: Improvement > Components: Iceberg integration > Reporter: Rajesh Balamohan > Assignee: Zsolt Miskolczi > Priority: Major > Labels: pull-request-available > Attachments: explain_merge_into.txt > > Time Spent: 50m > Remaining Estimate: 0h > > *Query:* > Think of "ssv" table as a table containing trickle feed data in the following > query. "store_sales_delete_1" is the destination table. > > {noformat} > MERGE INTO tpcds_1000_iceberg_mor_v4.store_sales_delete_1 t USING > tpcds_1000_update.ssv s ON (t.ss_item_sk = s.ss_item_sk > > AND t.ss_customer_sk=s.ss_customer_sk > > AND t.ss_sold_date_sk = "2451181" > > AND ((Floor((s.ss_item_sk) / 1000) * 1000) BETWEEN 1000 AND > 2000) > > AND s.ss_ext_discount_amt < 0.0) WHEN matched > AND t.ss_ext_discount_amt IS NULL THEN > UPDATE > SET ss_ext_discount_amt = 0.0 WHEN NOT matched THEN > INSERT (ss_sold_time_sk, > ss_item_sk, > ss_customer_sk, > ss_cdemo_sk, > ss_hdemo_sk, > ss_addr_sk, > ss_store_sk, > ss_promo_sk, > ss_ticket_number, > ss_quantity, > ss_wholesale_cost, > ss_list_price, > ss_sales_price, > ss_ext_discount_amt, > ss_ext_sales_price, > ss_ext_wholesale_cost, > ss_ext_list_price, > ss_ext_tax, > ss_coupon_amt, > ss_net_paid, > ss_net_paid_inc_tax, > ss_net_profit, > ss_sold_date_sk) > VALUES (s.ss_sold_time_sk, > s.ss_item_sk, > s.ss_customer_sk, > s.ss_cdemo_sk, > s.ss_hdemo_sk, > s.ss_addr_sk, > s.ss_store_sk, > s.ss_promo_sk, > s.ss_ticket_number, > s.ss_quantity, > s.ss_wholesale_cost, > s.ss_list_price, > s.ss_sales_price, > s.ss_ext_discount_amt, > s.ss_ext_sales_price, > s.ss_ext_wholesale_cost, > s.ss_ext_list_price, > s.ss_ext_tax, > s.ss_coupon_amt, > s.ss_net_paid, > s.ss_net_paid_inc_tax, > s.ss_net_profit, > "2451181") > {noformat} > > > *Issue:* > # Map phase is not getting vectorized due to "PARTITION_{_}SPEC{_}_ID" column > {noformat} > Map notVectorizedReason: Select expression for SELECT operator: Virtual > column PARTITION__SPEC__ID is not supported {noformat} > > 2. "Reducer 2" stage isn't vectorized. > {noformat} > Reduce notVectorizedReason: exception: java.lang.RuntimeException: Full Outer > Small Table Key Mapping duplicate column 0 in ordered column map {0=(value > column: 30, type info: int), 1=(value column: 31, type info: int)} when > adding value column 53, type into int stack trace: > org.apache.hadoop.hive.ql.exec.vector.VectorColumnOrderedMap.add(VectorColumnOrderedMap.java:102), > > org.apache.hadoop.hive.ql.exec.vector.VectorColumnSourceMapping.add(VectorColumnSourceMapping.java:41), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.canSpecializeMapJoin(Vectorizer.java:3865), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.validateAndVectorizeOperator(Vectorizer.java:5246), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.doProcessChild(Vectorizer.java:988), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.doProcessChildren(Vectorizer.java:874), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.validateAndVectorizeOperatorTree(Vectorizer.java:841), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer.access$2400(Vectorizer.java:251), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer$VectorizationDispatcher.validateAndVectorizeReduceOperators(Vectorizer.java:2298), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer$VectorizationDispatcher.validateAndVectorizeReduceOperators(Vectorizer.java:2246), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer$VectorizationDispatcher.validateAndVectorizeReduceWork(Vectorizer.java:2224), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer$VectorizationDispatcher.convertReduceWork(Vectorizer.java:2206), > > org.apache.hadoop.hive.ql.optimizer.physical.Vectorizer$VectorizationDispatcher.dispatch(Vectorizer.java:1038), > > org.apache.hadoop.hive.ql.lib.TaskGraphWalker.dispatch(TaskGraphWalker.java:111), > > org.apache.hadoop.hive.ql.lib.TaskGraphWalker.walk(TaskGraphWalker.java:180), > ... {noformat} > > I have attached the explain plan for this, which has details on this. -- This message was sent by Atlassian Jira (v8.20.10#820010)