dajiaohuang commented on code in PR #20059:
URL: https://github.com/apache/pinot/pull/20059#discussion_r4382988326


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java:
##########
@@ -645,18 +646,26 @@ private static int generatedArrayLength(long start, long 
end, long inc) {
   /// in `float` arithmetic, as the single-stage engine always did.
   private static int generatedArrayLength(float start, float end, float inc) {
     checkFloatingPointArguments(start, end, inc);
-    // TODO: decimal steps such as 0.1 are not exact in binary, so this can 
drop the end; see apache/pinot#19814
-    return checkGeneratedArrayLength((long) ((end - start) / inc + 1) - 1);
+    // Keep float arithmetic for the step count, but use double precision to 
compare its error with the input ULPs.

Review Comment:
   Thanks, you are right. The float overload computes the step count in double 
precision; I updated the Javadoc and inline comment to say that and clarified 
that the tolerance uses ULPs of the original float inputs. I also corrected the 
PR description, which had repeated the inaccurate float-arithmetic statement. 
The comment-only update is commit `0c5d4dfa1c4498918376c1faccfa32b3cb348aa7`; 
`git diff --check` passed. The focused 17-test run remains from the unchanged 
implementation commit; I did not rerun tests for this documentation-only change.



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