github-actions[bot] commented on code in PR #68029:
URL: https://github.com/apache/doris/pull/68029#discussion_r4058909768


##########
regression-test/suites/query_p0/sql_functions/math_functions/test_gamma.groovy:
##########
@@ -0,0 +1,59 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_gamma") {
+    sql " drop table if exists test_gamma"
+    sql """
+        create table test_gamma (
+            k0 int,
+            a double not null,
+            b double null
+        )
+        DISTRIBUTED BY HASH(k0)
+        PROPERTIES
+        (
+            "replication_num" = "1"
+        );
+    """
+
+    order_qt_empty_nullable "select gamma(b) from test_gamma"
+    order_qt_empty_not_nullable "select gamma(a) from test_gamma"
+
+    sql "insert into test_gamma values (1, 1, null), (1, 1, null), (1, 1, 
null)"
+    order_qt_all_null "select gamma(b) from test_gamma"
+
+    sql "truncate table test_gamma"
+    sql """ insert into test_gamma values
+        (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (6, 10, 10),
+        (7, 0, 0), (8, -0, -0), (9, -1, -1), (10, -2, -2), (11, -3, -3),

Review Comment:
   [P2] Construct an actual negative-zero input. Both occurrences of `-0` here 
are parsed as integer unary minus (`0 - 0`) before the DOUBLE column cast, so 
this row stores `+0.0` and duplicates row 7. Please use an explicit DOUBLE 
construction such as `cast('-0.0' as double)` and add a sign-sensitive check 
(for example `signbit(b)`) so the requested negative-zero boundary is genuinely 
exercised before relying on the `gamma` 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: [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