YiwenWu commented on code in PR #3695:
URL: https://github.com/apache/calcite/pull/3695#discussion_r1493900158


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -6110,6 +6110,18 @@ void checkRegexpExtract(SqlOperatorFixture f0, 
FunctionAlias functionAlias) {
         isWithin(1.4142d, 0.0001d));
     f.checkScalarApprox("sqrt(cast(2 as decimal(2, 0)))", "DOUBLE NOT NULL",
         isWithin(1.4142d, 0.0001d));
+    f.checkScalarApprox("sqrt(0)", "DOUBLE NOT NULL",
+        isWithin(0, 0.0001d));
+    f.checkScalarApprox("sqrt(0.1)", "DOUBLE NOT NULL",
+        isWithin(0.31622776601683794, 0.0001d));
+    f.checkScalarApprox("sqrt(2.0/3)", "DOUBLE NOT NULL",
+        isWithin(0.816496580927726, 0.0001d));
+    f.checkScalarApprox("sqrt(cast(10e8 as integer))", "DOUBLE NOT NULL",
+        isWithin(31622.776601683792, 0.0001d));
+    f.checkScalarApprox("sqrt(cast(10e8 as double))", "DOUBLE NOT NULL",
+        isWithin(31622.776601683792, 0.0001d));
+    f.checkScalarApprox("sqrt(-1)", "DOUBLE NOT NULL",
+        "NaN");

Review Comment:
   LGTM



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

Reply via email to