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

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

                Author: ASF GitHub Bot
            Created on: 03/Aug/22 00:53
            Start Date: 03/Aug/22 00:53
    Worklog Time Spent: 10m 
      Work Description: t3rmin4t0r commented on code in PR #3492:
URL: https://github.com/apache/hive/pull/3492#discussion_r936143948


##########
pom.xml:
##########
@@ -58,7 +58,7 @@
     <module>testutils</module>
     <module>packaging</module>
     <module>standalone-metastore</module>
-    <module>upgrade-acid</module>

Review Comment:
   Remove the pom.xml from the PR



##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java:
##########
@@ -66,10 +66,13 @@ public int findScalarInMap(MapColumnVector mapColumnVector, 
int mapBatchIndex) {
     byte[][] keyVector = keyColVector.vector;
     int[] keyStart = keyColVector.start;
     int[] keyLength = keyColVector.length;
+    final boolean isRepeating = keyColVector.isRepeating;
     for (int i = 0; i < count; i++) {
       final int keyOffset = offset + i;
+      final int len = isRepeating? keyLength[i]: keyLength[keyOffset];

Review Comment:
   Is that supposed to be [i] or [0]
   
   The two rows look a bit wrong there.
   
   I would write keyOffset = isRepeating ? 0 : offset + i
   
   if the intention was to use =0 for all repeating.





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

    Worklog Id:     (was: 797458)
    Time Spent: 20m  (was: 10m)

> Vectorization: wrong results when filter on repeating map key orc table
> -----------------------------------------------------------------------
>
>                 Key: HIVE-26447
>                 URL: https://issues.apache.org/jira/browse/HIVE-26447
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 3.1.3, 4.0.0
>            Reporter: Yi Zhang
>            Assignee: Yi Zhang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Example reproducible case:
>  
> set hive.vectorized.execution.enabled=true;
> set hive.fetch.task.conversion=none;
> create temporary table foo (id int, x map<string,int>) stored as orc;
> insert into foo values(1, map('ABC', 9)), (2, map('ABC', 7)), (3, map('ABC', 
> 8)), (4, map('ABC', 9));
> select id from foo where x['ABC']=9;
> this only gives 1, when correct result should be 1,4
> For every VectorizedRowBatch, only the first row is checked.  
> This seems to be a corner case of ORC table have repeating string type key 
> for map field in the MapColumnVector.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to