> On Nov. 7, 2019, 9:56 a.m., Rajesh Balamohan wrote: > > ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorTopNKeyOperator.java > > Lines 87-106 (patched) > > <https://reviews.apache.org/r/71708/diff/1/?file=2170959#file2170959line87> > > > > Can be separate class as this can be shared with TopNOperator as well?
My initial patch didn't use `VectorHashKeyWrapperBatch` and `VectorHashKeyWrapperBase*` to store the keys so I changed that to use it. VectorHashKeyWrapperBase extends KeyWrapper however it requires a different comparison logic because it doesn't reuses the existing methods from KeyWrapper: The method `Object[] getKeyArray()` can not be called because it throws UnsupportedOperationException and it would be required for a common comparator. - Krisztian ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71708/#review218562 ----------------------------------------------------------- On Nov. 11, 2019, 2:25 p.m., Krisztian Kasa wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71708/ > ----------------------------------------------------------- > > (Updated Nov. 11, 2019, 2:25 p.m.) > > > Review request for hive, Gopal V, Jesús Camacho Rodríguez, Zoltan Haindrich, > and Rajesh Balamohan. > > > Bugs: HIVE-20148 and HIVE-22435 > https://issues.apache.org/jira/browse/HIVE-20148 > https://issues.apache.org/jira/browse/HIVE-22435 > > > Repository: hive-git > > > Description > ------- > > Exception when using VectorTopNKeyOperator operator > =================================================== > > VectorTopNKeyOperator extends TopNKeyOperator and it calls it's > super.initializeOp method > https://github.com/apache/hive/blob/5c8392468cb581f53b6cb55d201fc933dca025e3/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorTopNKeyOperator.java#L71 > > which is focusing on non-vectorized execution. > > Fix: Derive VectorTopNKeyOperator from Oprator instead of TopNKeyOperator and > do the initialization > - map the key columns with the inputObjInspectors > - setup comparators for mapped keys using the objectInspector extracted from > the the inputObjInspectors > - add KeyWeapped class for storing key entries in the priorityQueue > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/exec/TopNKeyFilter.java PRE-CREATION > ql/src/java/org/apache/hadoop/hive/ql/exec/TopNKeyOperator.java 4734824b73 > > ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorTopNKeyOperator.java > c80bc804a2 > > ql/src/java/org/apache/hadoop/hive/ql/exec/vector/wrapper/VectorHashKeyWrapperBatch.java > dd31991d03 > > ql/src/java/org/apache/hadoop/hive/ql/exec/vector/wrapper/VectorHashKeyWrapperGeneralComparator.java > PRE-CREATION > ql/src/test/queries/clientpositive/vector_topnkey.q e1b7d26afe > ql/src/test/results/clientpositive/llap/vector_topnkey.q.out d859270ff0 > > serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectComparator.java > PRE-CREATION > > > Diff: https://reviews.apache.org/r/71708/diff/2/ > > > Testing > ------- > > run q test: vector_topnkey and limit_pushdown3 after applying the patch for > TopNKey pushdown > (https://issues.apache.org/jira/secure/attachment/12984389/HIVE-20150.15.patch) > > > Thanks, > > Krisztian Kasa > >