ngsg commented on code in PR #5543:
URL: https://github.com/apache/hive/pull/5543#discussion_r1855730509


##########
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/expressions/TestMurmurHashExpression.java:
##########
@@ -241,4 +241,143 @@ public void testMurmurHashWithNullsInt() throws 
HiveException {
           ((LongColumnVector) vrb.cols[2]).vector[i]);
     }
   }
+
+  @Test
+  public void testMurmurHashStringColStringColSingleRepeating() throws 
HiveException {
+    BytesColumnVector cvString1 = (BytesColumnVector) 
ColumnVectorGenUtil.generateColumnVector(
+        TypeInfoFactory.getPrimitiveTypeInfo("string"), false, false, SIZE, 
rand);
+
+    byte[] repeatedValue = new byte[10];
+    rand.nextBytes(repeatedValue);
+
+    BytesColumnVector cvString2 = new BytesColumnVector(SIZE);
+    cvString2.initBuffer(10);
+    cvString2.noNulls = false;
+    cvString2.isRepeating = true;
+    cvString2.setRef(0, repeatedValue, 0, 10);
+
+    for (int i = 1; i < SIZE; i++) {
+      cvString2.length[i] = 10;
+    }
+
+    VectorizedRowBatch vrb = new VectorizedRowBatch(3, SIZE);
+    vrb.cols[0] = cvString1;
+    vrb.cols[1] = cvString2;
+    vrb.cols[2] = new LongColumnVector(SIZE);
+
+    new MurmurHashStringColStringCol(0, 1, 2).evaluate(vrb);
+
+    Assert.assertEquals(false, vrb.cols[2].isRepeating);

Review Comment:
   Yes, it ensures that `MurmurHash` produces `isRepeating=false` ColumnVector 
for `isRepeating=true` and `isRepeating=false` ColumnVectors. Currrent tests 
check `true, true`  and `false, false` cases only.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to