Jackie-Jiang commented on code in PR #17652:
URL: https://github.com/apache/pinot/pull/17652#discussion_r2785335095


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/TruncateDecimalTransformFunction.java:
##########
@@ -98,7 +98,22 @@ public double[] transformToDoubleValuesSV(ValueBlock 
valueBlock) {
       }
     } else {
       for (int i = 0; i < length; i++) {
-        _doubleValuesSV[i] = Math.signum(leftValues[i]) * 
Math.floor(Math.abs(leftValues[i]));
+        double value = leftValues[i];
+        if (!Double.isFinite(value)) {
+          // Preserve historical behavior for NaN and infinities.
+          _doubleValuesSV[i] = value;
+          continue;
+        }
+        double truncated;
+        if (value > 0.0d) {
+          truncated = Math.floor(value);
+        } else if (value < 0.0d) {
+          truncated = Math.ceil(value);
+        } else {
+          truncated = 0.0d;
+        }
+        // Normalize -0.0 to +0.0 for deterministic output and test stability.

Review Comment:
   Is this needed? This is an actual production fix, suggest putting it in a 
separate PR



##########
pinot-controller/src/test/java/org/apache/pinot/controller/api/PinotTableRestletResourceTest.java:
##########
@@ -1197,18 +1197,21 @@ public void testTableTasksCleanupWithNonActiveTasks()
     String taskName = 
taskInfo.values().iterator().next().getScheduledTaskNames().get(0);
     waitForTaskState(taskName, TaskState.IN_PROGRESS);
 
-    // stop the task queue to abort the task
+    // Stop the task queue to abort the task. Keep it stopped until table 
deletion is complete to avoid

Review Comment:
   Is this test capturing a race condition?



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