xiangfu0 commented on code in PR #11848:
URL: https://github.com/apache/pinot/pull/11848#discussion_r1369272470


##########
pinot-core/src/test/java/org/apache/pinot/core/operator/transform/function/TupleSelectionTransformFunctionsTest.java:
##########
@@ -323,7 +323,7 @@ public void testGreatestTransformFunctionIntFloat() {
     assertEquals(transformFunction.getResultMetadata().getDataType(), 
FieldSpec.DataType.DOUBLE);
     double[] doubleValues = 
transformFunction.transformToDoubleValuesSV(_projectionBlock);
     for (int i = 0; i < NUM_ROWS; i++) {
-      assertEquals(doubleValues[i], Math.max(Math.max(_intSVValues[i], -1), 
_doubleSVValues[i]));
+      assertEquals(doubleValues[i], Math.max(Math.max(_intSVValues[i], -1), 
Double.valueOf(_floatSVValues[i])));

Review Comment:
   This is due to how we generate the float and double values,
   ```
         _intSVValues[i] = RANDOM.nextInt();
         _longSVValues[i] = RANDOM.nextLong();
         _floatSVValues[i] = _intSVValues[i] * RANDOM.nextFloat();
         _doubleSVValues[i] = _intSVValues[i] * RANDOM.nextDouble();
   ```
   So `max(_intSVValues[i], -1, _floatSVValues[i])` should be:
   `int` if `int >= 0`
   when int<0, since the absolute value is very large, the only possibility is 
that the random double is very small, which makes the double value fall into 
the range of [-1 ,0]
   
   
   



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