xiedeyantu commented on code in PR #4838:
URL: https://github.com/apache/calcite/pull/4838#discussion_r2944167636


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -11914,4 +11914,63 @@ public Sql schema(CalciteAssert.SchemaSpec schemaSpec) 
{
         .ok(expected2);
   }
 
+  /**
+   * Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-7432";>[CALCITE-7432]
+   * NumberFormatException when converting NaN literal to SQL</a>.
+   */
+  @Test void testCastNaNToDouble() {
+    final String sql = "select cast('NaN' as DOUBLE)";
+    final String expected = "SELECT *\n"
+        + "FROM (VALUES (CAST('NaN' AS DOUBLE))) AS \"t\" (\"EXPR$0\")";
+    sql(sql).ok(expected);
+  }
+
+  /**
+   * Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-7432";>[CALCITE-7432]
+   * Support casting positive infinity to DOUBLE</a>.
+   */
+  @Test void testCastInfinityToDouble() {
+    final String sql = "select cast('Infinity' as DOUBLE)";
+    final String expected = "SELECT *\n"
+        + "FROM (VALUES (CAST('Infinity' AS DOUBLE))) AS \"t\" (\"EXPR$0\")";
+    sql(sql).ok(expected);
+  }
+
+  /**
+   * Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-7432";>[CALCITE-7432]
+   * Support casting negative infinity to DOUBLE</a>.

Review Comment:
   This Javadoc is incorrect. We should keep it consistent with the PR title 
and JIRA title. I agree with @xuzifu666; it's better to consolidate all cases 
into one, adding comments above each.



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