dssysolyatin commented on code in PR #4858:
URL: https://github.com/apache/calcite/pull/4858#discussion_r3068145496


##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -1322,13 +1322,20 @@ void testLikeAndSimilarFails() {
     expr("values 1.0 + ^NULL^")
         .withTypeCoercion(false)
         .fails("(?s).*Illegal use of .NULL.*");
+    // SELECT produces DECIMAL(3, 1) because inferUnknownTypes infers
+    // NULL as DECIMAL(2, 1) via FIRST_KNOWN, and DECIMAL(2,1) + DECIMAL(2,1)
+    // = DECIMAL(3, 1)
+    sql("select 1.0 + NULL from (values (0)) as t(x)")
+        .columnType("DECIMAL(3, 1)");
     expr("values 1.0 + NULL")
-        .columnType("DECIMAL(2, 1)");
+        .columnType("DECIMAL(3, 1)");

Review Comment:
   Right, if you open task description - 
https://issues.apache.org/jira/browse/CALCITE-7457. It will contain test case 
for main branch



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