[ https://issues.apache.org/jira/browse/HIVE-26006?focusedWorklogId=737598&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-737598 ]
ASF GitHub Bot logged work on HIVE-26006: ----------------------------------------- Author: ASF GitHub Bot Created on: 07/Mar/22 16:16 Start Date: 07/Mar/22 16:16 Worklog Time Spent: 10m Work Description: kasakrisz opened a new pull request #3082: URL: https://github.com/apache/hive/pull/3082 <!-- 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 pushing TNK through GBY the new TNK operator created on top should contain the common key prefix of the original TNK and the GBY. ``` Group By Operator keys: KEY._col0 (type: int), KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: int) Top N Key Operator keys: _col0 (type: int), _col2 (type: int), _col3 (type: int) Map-reduce partition columns: _col0 (type: int), _col2 (type: int) ``` The common key prefix is: `_col0 (type: int)` Map-reduce partition columns is also a prefix of the keys. When calculating the new TNK's Map-reduce partition columns take the whole common key prefix if common key prefix of the original TNK and the GBY is smaller than the original TNK's Map-reduce partition columns. ### Why are the changes needed? When calculating the new TNK's Map-reduce partition columns `ArrayIndexOutOfBoundsException` is thrown when the common key prefix of the original TNK and the GBY is smaller than the original TNK's Map-reduce partition columns. ### Does this PR introduce _any_ user-facing change? No `ArrayIndexOutOfBoundsException` is thrown. ### How was this patch tested? ``` mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=ptf_tnk.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-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 737598) Remaining Estimate: 0h Time Spent: 10m > TopNKey and PTF with more than one column is failing with IOBE > -------------------------------------------------------------- > > Key: HIVE-26006 > URL: https://issues.apache.org/jira/browse/HIVE-26006 > Project: Hive > Issue Type: Bug > Reporter: Naresh P R > Assignee: Krisztian Kasa > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > {code:java} > java.lang.IndexOutOfBoundsException: toIndex = 2 > at java.util.ArrayList.subListRangeCheck(ArrayList.java:1014) > at java.util.ArrayList.subList(ArrayList.java:1006) > at org.apache.hadoop.hive.ql.plan.TopNKeyDesc.combine(TopNKeyDesc.java:201) > at > org.apache.hadoop.hive.ql.optimizer.topnkey.TopNKeyPushdownProcessor.pushdownThroughGroupBy(TopNKeyPushdownProcessor.java:162) > at > org.apache.hadoop.hive.ql.optimizer.topnkey.TopNKeyPushdownProcessor.pushdown(TopNKeyPushdownProcessor.java:76) > at > org.apache.hadoop.hive.ql.optimizer.topnkey.TopNKeyPushdownProcessor.process(TopNKeyPushdownProcessor.java:57) > at > org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90) > at > org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:105) > at > org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:89) > at > org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:158) > at > org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:120) > at > org.apache.hadoop.hive.ql.parse.TezCompiler.runTopNKeyOptimization(TezCompiler.java:1305) > at > org.apache.hadoop.hive.ql.parse.TezCompiler.optimizeOperatorPlan(TezCompiler.java:173) > at org.apache.hadoop.hive.ql.parse.TaskCompiler.compile(TaskCompiler.java:159) > at > org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12646) > at > org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:358) > at > org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:283) > at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:219) > at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:103) > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:215){code} -- This message was sent by Atlassian Jira (v8.20.1#820001)