NobiGo commented on code in PR #4071:
URL: https://github.com/apache/calcite/pull/4071#discussion_r1866860802


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -11692,9 +11692,9 @@ void assertSubFunReturns(boolean binary, String s, int 
start,
       f12.checkScalar("NVL2(NULL, 3.0, 2.111)", "2.111", "DECIMAL(4, 3) NOT 
NULL");
       f12.checkScalar("NVL2(3.111, 3.1415926, 2.111)", "3.1415926", 
"DECIMAL(8, 7) NOT NULL");
 
-      f12.checkNull("nvl2('ab', CAST(NULL AS VARCHAR(6)), 'def')");
-      f12.checkNull("nvl2(NULL, 'abc', NULL)");
-      f12.checkNull("nvl2(NULL, NULL, NULL)");
+      f12.checkNullValueWithNullableType("nvl2('ab', CAST(NULL AS VARCHAR(6)), 
'def')");

Review Comment:
   There are two ways to fix this issue. 
   One way is to first fix all function issues with 
`checkNullValueWithNullableType`, and then strengthen the 'checkNull' method to 
detect return data type is nullable, then delete  
`checkNullValueWithNullableType`.
   The other way is to directly delete the 'checkNullValueWithNullableType' 
method, and then use different methods to retest `checkNull`, such as `check`, 
which will retest the value and return type. The `checkNull` method is 
meaningless.
   Do you have any suggestions?



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