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


##########
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);
+
+    Text t2 = new Text(repeatedValue);
+    for (int i = 0; i < SIZE; i++) {
+      Text t1 = new Text();
+      t1.set(cvString1.vector[i], cvString1.start[i], cvString1.length[i]);
+
+      Assert.assertEquals(
+          ObjectInspectorUtils.getBucketHashCode(

Review Comment:
   I agree that the values we are comparing are computed in the same way. 
Removed calling `getBucketHashCode` and modified the tests to compare against 
some hardcoded values.



-- 
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