xuzifu666 commented on code in PR #4679:
URL: https://github.com/apache/calcite/pull/4679#discussion_r2615965977


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -825,6 +825,36 @@ void testCastToExactNumeric(CastType castType, 
SqlOperatorFixture f) {
     f.checkNull("CAST(CAST(NULL AS VARCHAR) AS VARBINARY)");
   }
 
+  /**
+   * Test case for <a 
href="https://issues.apache.org/jira/browse/CALCITE-7323";>
+   * Result of cast Number to Boolean is not correct</a>. */
+  @Test public void testNumbericBooleanCast() {
+    SqlOperatorFixture f = fixture();
+    f.setFor(SqlStdOperatorTable.MAX, VM_EXPAND);
+    String[] values = {"0", "CAST(null AS INTEGER)", "2", "2"};
+    f.checkAgg("cast(max(x) as BOOLEAN)", values, isSingle(true));

Review Comment:
   It seems that ```SqlOperatorTest``` primarily contains tests for the 
constant type. I'm unsure whether this test pertains to the non-constant type. 
Additionally, I added a test for the var type in ```RelToSqlConverterTest```, 
but I'm not entirely certain if it complies. @mihaibudiu 



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