You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ay...@apache.org on 2023/06/22 04:05:07 UTC

[hive] branch master updated: HIVE-27368: Vectorization: ArrayIndexOutOfBoundsException when map key vector has repeating values (#4352). (Alagappan Maruthappan, reviewed by Ayush Saxena, Attila Turoczy)

This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d392cee4a5 HIVE-27368: Vectorization: ArrayIndexOutOfBoundsException when map key vector has repeating values (#4352). (Alagappan Maruthappan, reviewed by Ayush Saxena, Attila Turoczy)
7d392cee4a5 is described below

commit 7d392cee4a5c9cb79d9339829879265c707866ed
Author: Alagappan Maruthappan <as...@gmail.com>
AuthorDate: Wed Jun 21 21:05:01 2023 -0700

    HIVE-27368: Vectorization: ArrayIndexOutOfBoundsException when map key vector has repeating values (#4352). (Alagappan Maruthappan, reviewed by Ayush Saxena, Attila Turoczy)
---
 .../hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java
index 02274924b98..cc3ff104a49 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorUDFMapIndexStringScalar.java
@@ -69,10 +69,11 @@ public class VectorUDFMapIndexStringScalar extends VectorUDFMapIndexBaseScalar {
     final boolean isRepeating = keyColVector.isRepeating;
     for (int i = 0; i < count; i++) {
       final int keyOffset = offset + i;
+      final int start = isRepeating? keyStart[0]: keyStart[keyOffset];
       final int len = isRepeating? keyLength[0]: keyLength[keyOffset];
       byte[] rowKey = isRepeating? keyVector[0]: keyVector[keyOffset];
       if (StringExpr.equal(key, 0, key.length,
-          rowKey, keyStart[keyOffset], len)) {
+          rowKey, start, len)) {
         return offset + i;
       }
     }