You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "abhinav-phi (via GitHub)" <gi...@apache.org> on 2026/10/04 22:44:50 UTC

[PR] [fix](nereids) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

abhinav-phi opened a new pull request, #68731:
URL: https://github.com/apache/doris/pull/68731

   ### What problem does this PR solve?
   
   Issue Number: close #68719
   
   Related PR: None
   
   Problem Summary:
   
   `ceil(DoubleLiteral)` and `round(DoubleLiteral)` folded through `DecimalV3Literal` at scale 0:
   
   ```java
   DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
           new BigDecimal(Double.toString(first.getValue())));
   return new DoubleLiteral(middleResult.roundCeiling(0).getDouble());
   ```
   
   `BigDecimal` has no signed zero, so `ceil(-0.5)` folded to `+0` and `round(-0.4)` folded to `+0`.
   BE computes these with `std::ceil` / `std::round` (`be/src/exprs/function/round.h`,
   `roundWithMode<double>`), which return `-0`. The reported symptom is exactly that:
   
   ```
   SELECT signbit(ceil(CAST(-0.5 AS DOUBLE))) AS fe, signbit(ceil(d1)) AS be FROM t;
   +------+------+
   | fe   | be   |
   |    0 |    1 |
   +------+------+
   ```
   
   The fix drops the decimal detour: `Math.ceil(value)` for `ceil`, and for `round` the half-away-from-zero
   rule with the sign carried over (`Math.copySign(Math.floor(Math.abs(value) + 0.5), value)`), which is
   what `std::round` does. The bankers variant is a separate BE function (`round_bankers`) and is not
   touched here.
   
   `NaN` and both infinities keep their existing behaviour through this formulation, and integral,
   date and decimal targets are unchanged.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
   
     New `NumericArithmeticTest.testCeilAndRoundKeepSignedZero` asserts the sign of the folded zero for
     `ceil(-0.5)` and `round(-0.4)`, that `round(0.4)` stays positive zero, the half-away-from-zero ties
     (`round(2.5) = 3`, `round(-2.5) = -3`), ordinary values (`ceil(1.2) = 2`, `ceil(-1.5) = -1`),
     `ceil(+Inf) = +Inf` and `round(NaN) = NaN`.
   
     Red, on `master` with only the test added:
   
     ```
     [ERROR]   NumericArithmeticTest.testCeilAndRoundKeepSignedZero:93 expected: <true> but was: <false>
     ```
   
     Green, focused run with the fix:
   
     ```
     [INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 - in NumericArithmeticTest
     [INFO] BUILD SUCCESS
     ```
   
     Wider net (`NumericArithmeticTest, FoldConstantTest, ConstantProjectionFoldingTest,
     InferPredicateFromMonotonicFunctionTest, CastTest, DoubleLiteralTest`) on the patched tree:
   
     ```
     NumericArithmeticTest            Tests run: 5,  Failures: 0
     DoubleLiteralTest                Tests run: 2,  Failures: 0
     CastTest                         Tests run: 23, Failures: 0
     ConstantProjectionFoldingTest    Tests run: 1,  Failures: 0
     InferPredicateFromMonotonicFunctionTest  Tests run: 37, Failures: 0
     ```
   
     The wider run still exits non-zero because of two `FoldConstantTest` failures
     (`testDateConstructFunction:1552`, `testFoldString:581`). Those are **pre-existing on this machine
     and unrelated to this change** - they fail identically on pristine `master` with all of my edits
     stashed, and they are session-time-zone dependent timestamp assertions:
   
     ```
     [ERROR]   FoldConstantTest.testDateConstructFunction:1552 expected: <'1977-06-03 17:57:24'> but was: <'1977-06-03 15:27:24'>
     [ERROR]   FoldConstantTest.testFoldString:581 expected: <'2025-10-27 14:58:08.100000'> but was: <'2025-10-27 12:28:08.100000'>
     ```
   
     Command (the project's own flags from `run-fe-ut.sh`):
   
     ```
     mvn test -pl fe-core -am -Dcheckstyle.skip=true -DfailIfNoTests=false \
         -Dmaven.build.cache.enabled=false -Dtest=NumericArithmeticTest
     ```
   
     Environment: JDK 17.0.20 (Temurin), Maven 3.9.16, thrift 0.24.0 from the prebuilt thirdparty
     package, Ubuntu 22.04 under WSL2. Style gate `mvn -pl fe-core checkstyle:check` ->
     `You have 0 Checkstyle violations.`
   
     Scope note: `round(x, 0)` and `truncate(x)` reach the same decimal detour for a scale-0 result and
     therefore have the same sign-of-zero loss. I deliberately left them out of this PR because the
     report is about the 1-arg `ceil`/`round`; happy to fold them in here or in a follow-up if a
     maintainer prefers one change.
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. <!-- Explain the behavior change -->
         Folding `ceil(<double literal in (-1,0))>` and `round(<double literal that rounds to zero>)`
         now yields `-0.0` instead of `+0.0`, matching the BE result for the same value, so `signbit()`
         agrees between the constant path and the column path. Magnitudes are unchanged.
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label
   
   ### AI assistance disclosure
   
   An AI coding agent was used to draft this change and the new test. I read and reviewed every line
   myself, checked the BE semantics in `be/src/exprs/function/round.h` against what the FE now computes,
   ran the FE unit tests above on the exact commit in this branch, and I take responsibility for the
   result.
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](nereids) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-5985270819

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://doris.apache.org/community/how-to-contribute/review-and-ci).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "abhinav-phi (via GitHub)" <gi...@apache.org>.
abhinav-phi commented on code in PR #68731:
URL: https://github.com/apache/doris/pull/68731#discussion_r4296945902


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -364,9 +364,10 @@ public static Expression round(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "round")
     public static Expression round(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.round(0).getDouble());
+        // BE uses std::round(): half away from zero, and a zero result keeps the sign of the
+        // argument. Rounding through BigDecimal at scale 0 collapses -0.4 to positive zero.
+        double value = first.getValue();
+        return new DoubleLiteral(Math.copySign(Math.floor(Math.abs(value) + 0.5), value));

Review Comment:
   fixed in 8da19ea9. the threshold no longer comes from adding a half to the input. `round(DoubleLiteral)` now takes the fractional part and compares that:
   
       double magnitude = Math.abs(value);
       double truncated = Math.floor(magnitude);
       if (magnitude - truncated >= 0.5) {
           truncated += 1.0;
       }
       return new DoubleLiteral(Math.copySign(truncated, value));
   
   `magnitude - truncated` is exact for every finite magnitude of 1 or above, and below 1 it is just the magnitude itself, so neither of the two cases you raised can reach a wrong branch. `round(CAST(0.49999999999999994 AS DOUBLE))` folds to 0.0 and `round(CAST(4503599627370497.0 AS DOUBLE))` comes back unchanged. both are asserted in NumericArithmeticTest now, along with the sign of a zero result.



##########
fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmeticTest.java:
##########
@@ -86,4 +86,34 @@ private void assertInterval(int expected, long compareValue, long... thresholds)
                 new BigIntLiteral(compareValue), thresholdLiterals);
         Assertions.assertEquals(expected, result.getValue());
     }
+
+    @Test
+    public void testCeilAndRoundKeepSignedZero() {
+        DoubleLiteral ceil = (DoubleLiteral) NumericArithmetic.ceil(new DoubleLiteral(-0.5));
+        Assertions.assertTrue(isNegativeZero(ceil.getValue()));
+
+        DoubleLiteral round = (DoubleLiteral) NumericArithmetic.round(new DoubleLiteral(-0.4));

Review Comment:
   fixed in 8da19ea9. both scale zero DOUBLE overloads now hand off to the unary binary path instead of going through BigDecimal:
   
       public static Expression round(DoubleLiteral first, IntegerLiteral second) {
           if (second.getValue() == 0) {
               return round(first);
           }
   
   `ceil(DoubleLiteral, IntegerLiteral)` does the same against `ceil(first)`, which matches the dispatch the BE makes for scale 0. `round(CAST(-0.4 AS DOUBLE), 0)` and `ceil(CAST(-0.5 AS DOUBLE), 0)` are both in the parameterized set now with the sign of the zero result asserted, so the two overloads can not drift back apart.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -401,9 +402,8 @@ public static Expression ceil(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "ceil")
     public static Expression ceil(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.roundCeiling(0).getDouble());
+        // BE uses std::ceil(), which keeps the sign of a zero result.

Review Comment:
   fixed in 8da19ea9, in `NumericLiteral.compareTo` rather than at the call site you anchored on:
   
       double self = this.getDouble();
       double otherValue = ((Literal) other).getDouble();
       if (self == otherValue) {
           return 0;
       }
       return Double.compare(self, otherValue);
   
   the `==` settles the two signed zeros as one SQL value before `Double.compare` can order -0.0 below +0.0. every other ordering is untouched, because for all non zero doubles `==` and `Double.compare` agree, and the NaN case still falls through to `Double.compare` so the total order over NaN is preserved. `ceil(CAST(-0.5 AS DOUBLE)) = CAST(0 AS DOUBLE)` now folds to TRUE.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -401,9 +402,8 @@ public static Expression ceil(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "ceil")
     public static Expression ceil(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.roundCeiling(0).getDouble());
+        // BE uses std::ceil(), which keeps the sign of a zero result.

Review Comment:
   fixed in 8da19ea9, but on DoubleLiteral rather than on `Literal.equals`. changing `Literal.equals` would move the equality contract for every literal type at once, so I overrode it where the value is actually a double:
   
       public boolean equals(Object o) {
           if (!(o instanceof DoubleLiteral)) {
               return false;
           }
           double other = ((DoubleLiteral) o).getValue();
           return value == other || (Double.isNaN(value) && Double.isNaN(other));
       }
   
   with a matching `computeHashCode` over `Double.hashCode(value == 0.0 ? 0.0 : value)`, so a folded -0.0 and a +0.0 also land in the same bucket. java dispatches to the override, so `visitInPredicate` and the set dedup both see one value, which is the BE behaviour. `ceil(CAST(-0.5 AS DOUBLE)) IN (CAST(0 AS DOUBLE), CAST(1 AS DOUBLE))` folds to TRUE and is asserted.
   
   one thing i want to flag rather than bury: FloatLiteral has the identical bit comparison today. i did not change it here because that widening is the subject of sibling pr #68730 and i did not want two branches editing the same equality question. if you would prefer this rule on `Literal` so both float and double get it in one place, say so and i will move it.



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #68731:
URL: https://github.com/apache/doris/pull/68731#discussion_r4226506758


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -401,9 +402,8 @@ public static Expression ceil(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "ceil")
     public static Expression ceil(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.roundCeiling(0).getDouble());
+        // BE uses std::ceil(), which keeps the sign of a zero result.

Review Comment:
   [P1] Align FE numeric comparison with the newly preserved negative zero. `ceil(CAST(-0.5 AS DOUBLE))` now folds to `DoubleLiteral(-0.0)`, but `NumericLiteral.compareTo` calls `Double.compare(-0.0, +0.0)` and returns -1. FE therefore folds `ceil(CAST(-0.5 AS DOUBLE)) = CAST(0 AS DOUBLE)` to FALSE, while BE treats the zeros as equal; `RangeInference` can also erase `x >= +0 AND x <= ceil(-0.5)` even though `x = 0` qualifies. Unary `round(-0.4)` has the same path. Please correct the shared numeric comparator semantics and cover folded predicates and ranges.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -364,9 +364,10 @@ public static Expression round(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "round")
     public static Expression round(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.round(0).getDouble());
+        // BE uses std::round(): half away from zero, and a zero result keeps the sign of the
+        // argument. Rounding through BigDecimal at scale 0 collapses -0.4 to positive zero.
+        double value = first.getValue();
+        return new DoubleLiteral(Math.copySign(Math.floor(Math.abs(value) + 0.5), value));

Review Comment:
   [P1] Avoid rounding the input while computing the rounding threshold. For `0.49999999999999994` (the representable DOUBLE immediately below 0.5), `Math.abs(value) + 0.5` becomes exactly `1.0`, so FE folds `round(CAST(0.49999999999999994 AS DOUBLE))` to 1 even though BE `std::round` returns 0; the negative input becomes -1 instead of -0. The same expression changes an already integral `4503599627370497.0` to `4503599627370498.0`. Please use a half-away-from-zero algorithm that does not perform this inexact addition, and cover both boundaries in folding tests.



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java:
##########
@@ -401,9 +402,8 @@ public static Expression ceil(DecimalV3Literal first, IntegerLiteral second) {
      */
     @ExecFunction(name = "ceil")
     public static Expression ceil(DoubleLiteral first) {
-        DecimalV3Literal middleResult = DecimalV3Literal.createWithoutCheck256(
-                new BigDecimal(Double.toString(first.getValue())));
-        return new DoubleLiteral(middleResult.roundCeiling(0).getDouble());
+        // BE uses std::ceil(), which keeps the sign of a zero result.

Review Comment:
   [P1] Use SQL value equality where the newly preserved negative zero enters sets. `ceil(CAST(-0.5 AS DOUBLE)) IN (CAST(0 AS DOUBLE), CAST(1 AS DOUBLE))` reaches `visitInPredicate`, whose `Literal.equals` check treats -0.0 and +0.0 as different, so FE folds FALSE; BE `HybridSet` returns TRUE. `RangeInference.intersect` similarly uses `retainAll` and can erase `x = ceil(-0.5) AND x = +0` even though `x = 0` qualifies. Correct these semantic equality sites, while retaining sign-sensitive expression identity for `signbit`, and add composed `IN` and range tests.



##########
fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmeticTest.java:
##########
@@ -86,4 +86,34 @@ private void assertInterval(int expected, long compareValue, long... thresholds)
                 new BigIntLiteral(compareValue), thresholdLiterals);
         Assertions.assertEquals(expected, result.getValue());
     }
+
+    @Test
+    public void testCeilAndRoundKeepSignedZero() {
+        DoubleLiteral ceil = (DoubleLiteral) NumericArithmetic.ceil(new DoubleLiteral(-0.5));
+        Assertions.assertTrue(isNegativeZero(ceil.getValue()));
+
+        DoubleLiteral round = (DoubleLiteral) NumericArithmetic.round(new DoubleLiteral(-0.4));

Review Comment:
   [P2] Cover the explicit scale-zero DOUBLE overloads as well. The new test and implementation handle only unary calls, but `round(CAST(-0.4 AS DOUBLE), 0)` and `ceil(CAST(-0.5 AS DOUBLE), 0)` still use the BigDecimal overloads below and FE folds both to positive zero; BE's scale-zero dispatch calls `std::round`/`std::ceil` and returns negative zero. This leaves `signbit` dependent on whether the argument is constant or a column for the same public functions. Please extend the fix and a folded-expression test to these overloads (or explicitly arrange a tracked follow-up if this PR must remain unary-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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "abhinav-phi (via GitHub)" <gi...@apache.org>.
abhinav-phi commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6220158412

   @morrySnow all four of the review findings are now answered in the thread, with the code at 8da19ea9.
   
   two things I cannot do myself on this branch:
   
   the push that carried those fixes dismissed your earlier approval, so the pr needs a fresh +1 from a committer.
   
   and the GitHub Actions runs on this head are still sitting at action_required, 16 of them, created 2026-10-14T20:08Z, none with a single job. as a first time contributor I cannot approve them. could someone approve and run them, and if it is easier `run buildall` on 8da19ea9 so the FE UT and regression suites report against this head rather than the old one. nothing is red right now, it is that nothing has ever executed on this head.
   
   the one open question I am deliberately leaving to you is on the second signed zero finding: I put the value equality override on DoubleLiteral rather than on Literal so this branch does not move equality for every literal type. FloatLiteral still compares bits today. if you would rather that rule live on Literal, say so and I will move it in this branch.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6074217729

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 24.37 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 35eca0a4d023670a2d648db1a4ae93851511c21f, data reload: false
   
   query1	0.01	0.00	0.01
   query2	0.10	0.05	0.05
   query3	0.26	0.12	0.12
   query4	1.60	0.11	0.12
   query5	0.29	0.25	0.26
   query6	1.16	0.68	0.67
   query7	0.04	0.01	0.01
   query8	0.06	0.03	0.04
   query9	0.42	0.34	0.35
   query10	0.57	0.58	0.55
   query11	0.21	0.14	0.14
   query12	0.19	0.15	0.14
   query13	0.48	0.48	0.49
   query14	0.97	0.98	0.95
   query15	0.66	0.60	0.61
   query16	0.35	0.36	0.35
   query17	1.11	1.10	1.16
   query18	0.22	0.20	0.21
   query19	2.07	2.01	2.01
   query20	0.02	0.02	0.01
   query21	15.49	0.28	0.14
   query22	4.47	0.05	0.05
   query23	16.23	0.33	0.12
   query24	3.38	0.67	0.43
   query25	0.14	0.04	0.05
   query26	1.25	0.26	0.15
   query27	0.04	0.03	0.03
   query28	1.84	0.60	0.39
   query29	12.48	4.10	3.24
   query30	0.29	0.13	0.14
   query31	2.77	0.57	0.34
   query32	3.22	0.62	0.52
   query33	3.16	3.17	3.19
   query34	15.38	4.03	3.39
   query35	3.33	3.34	3.33
   query36	0.55	0.47	0.44
   query37	0.09	0.07	0.06
   query38	0.05	0.04	0.03
   query39	0.03	0.03	0.03
   query40	0.17	0.14	0.14
   query41	0.08	0.04	0.03
   query42	0.04	0.03	0.03
   query43	0.04	0.03	0.04
   Total cold run time: 95.31 s
   Total hot run time: 24.37 s
   ```
   </details>
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "abhinav-phi (via GitHub) via commits" <co...@doris.apache.org>.
abhinav-phi commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-7013742879

   hi @morrySnow, gentle ping on this ceil and round sign-of-zero fix for issue #68719.. unit tests included and it is still waiting on a first review.. thanks


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6073872798

   /review


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6074069907

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 29507 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 35eca0a4d023670a2d648db1a4ae93851511c21f, data reload: false
   
   ------ Round 1 ----------------------------------
   ============================================
   q1	17613	5792	5597	5597
   q2	2132	310	261	261
   q3	10218	1473	860	860
   q4	4681	504	361	361
   q5	7432	815	690	690
   q6	187	184	156	156
   q7	812	812	602	602
   q8	9253	1355	1133	1133
   q9	5830	4499	4482	4482
   q10	6826	1332	1020	1020
   q11	432	259	240	240
   q12	635	411	298	298
   q13	18034	3091	2388	2388
   q14	271	265	260	260
   q15	q16	743	736	670	670
   q17	1184	750	577	577
   q18	7169	6284	6186	6186
   q19	1246	958	648	648
   q20	395	347	222	222
   q21	6121	2537	2660	2537
   q22	406	362	319	319
   Total cold run time: 101620 ms
   Total hot run time: 29507 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   ============================================
   q1	6651	6713	6808	6713
   q2	795	634	599	599
   q3	5886	5740	5316	5316
   q4	2135	2250	1641	1641
   q5	5690	5738	5825	5738
   q6	246	190	148	148
   q7	2223	2036	1843	1843
   q8	3315	2828	2826	2826
   q9	8214	8083	8131	8083
   q10	3706	3666	3315	3315
   q11	608	422	384	384
   q12	670	702	512	512
   q13	2763	3107	2391	2391
   q14	282	280	266	266
   q15	q16	676	691	632	632
   q17	7892	7022	6905	6905
   q18	13210	12269	13177	12269
   q19	951	841	845	841
   q20	2200	2213	1934	1934
   q21	5968	4823	4886	4823
   q22	504	469	414	414
   Total cold run time: 74585 ms
   Total hot run time: 67593 ms
   ```
   </details>
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6073860865

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6074168355

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 152472 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 35eca0a4d023670a2d648db1a4ae93851511c21f, data reload: false
   
   query5	4310	588	456	456
   query6	415	205	188	188
   query7	4796	448	219	219
   query8	327	183	165	165
   query9	8755	4062	4027	4027
   query10	462	314	260	260
   query11	5908	3455	3210	3210
   query12	141	88	82	82
   query13	1249	447	308	308
   query14	6546	4822	4560	4560
   query14_1	4356	4329	4305	4305
   query15	210	206	181	181
   query16	939	446	412	412
   query17	870	653	535	535
   query18	2431	424	314	314
   query19	217	163	138	138
   query20	85	85	80	80
   query21	207	140	117	117
   query22	13145	13028	12809	12809
   query23	13163	12672	12071	12071
   query23_1	12206	12314	12218	12218
   query24	7092	870	477	477
   query24_1	469	482	465	465
   query25	545	441	330	330
   query26	1264	249	135	135
   query27	2779	446	265	265
   query28	4620	1914	1910	1910
   query29	1547	585	447	447
   query30	289	216	179	179
   query31	900	764	645	645
   query32	136	88	89	88
   query33	512	305	234	234
   query34	909	861	506	506
   query35	767	779	633	633
   query36	805	829	726	726
   query37	126	96	90	90
   query38	1796	1755	1724	1724
   query39	698	732	704	704
   query39_1	664	683	669	669
   query40	219	118	97	97
   query41	76	74	65	65
   query42	92	85	83	83
   query43	379	386	337	337
   query44	1370	689	687	687
   query45	183	180	167	167
   query46	860	974	576	576
   query47	2945	2969	2945	2945
   query48	318	320	214	214
   query49	581	390	297	297
   query50	703	276	221	221
   query51	10484	10523	10509	10509
   query52	87	89	79	79
   query53	191	210	152	152
   query54	235	190	196	190
   query55	69	71	64	64
   query56	220	223	217	217
   query57	1636	1616	1571	1571
   query58	278	280	247	247
   query59	2356	2399	2155	2155
   query60	286	236	221	221
   query61	147	145	151	145
   query62	387	344	295	295
   query63	211	172	174	172
   query64	2763	942	754	754
   query65	3453	3373	3366	3366
   query66	1781	407	312	312
   query67	20190	20171	20014	20014
   query68	3077	1021	605	605
   query69	389	294	244	244
   query70	921	847	849	847
   query71	302	230	216	216
   query72	2754	2767	2444	2444
   query73	549	553	301	301
   query74	4656	4508	4332	4332
   query75	2335	2298	1981	1981
   query76	2318	1054	641	641
   query77	379	416	309	309
   query78	8969	9023	8417	8417
   query79	971	928	528	528
   query80	801	454	344	344
   query81	562	321	280	280
   query82	567	141	110	110
   query83	273	195	179	179
   query84	316	120	96	96
   query85	965	413	368	368
   query86	359	256	231	231
   query87	2058	1952	1821	1821
   query88	3656	2686	2681	2681
   query89	343	300	260	260
   query90	1708	187	184	184
   query91	161	145	123	123
   query92	97	90	77	77
   query93	1062	1017	557	557
   query94	516	317	274	274
   query95	598	413	318	318
   query96	685	529	241	241
   query97	2480	2433	2290	2290
   query98	161	150	143	143
   query99	780	762	658	658
   Total cold run time: 234669 ms
   Total hot run time: 152472 ms
   ```
   </details>
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6075788167

   # FE Regression Coverage Report
   Increment line coverage `  100.00% (3/3)` :tada:
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/68731_35eca0a4d023670a2d648db1a4ae93851511c21f_merge_fe/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/68731_35eca0a4d023670a2d648db1a4ae93851511c21f_merge_fe/report/index.html)
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](constant folding) Keep the sign of zero when folding ceil() and round() on DOUBLE [doris]

Posted by "abhinav-phi (via GitHub) via commits" <co...@doris.apache.org>.
abhinav-phi commented on PR #68731:
URL: https://github.com/apache/doris/pull/68731#issuecomment-6717131248

   @morrySnow could you take a final look at 8da19ea9? your approval from 9 oct was dismissed by the push that carried the fixes, so this has been sitting without a verdict since.
   
   the four bot findings from 9 oct were raised against the old head 35eca0a4 and are addressed in 8da19ea9: the rounding threshold no longer adds 0.5, and signed zero now agrees with the backend through equals, compareTo and computeHashCode on DoubleLiteral, FloatLiteral and NumericLiteral. the bot review still points at the pre-fix head, so it reads as unresolved even though the code changed.
   
   if something still blocks it, tell me what and i will fix it in one pass rather than another round of single items. if it is fine, a fresh +1 is all it needs.


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org