mihaibudiu commented on code in PR #4858:
URL: https://github.com/apache/calcite/pull/4858#discussion_r3068144066
##########
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:
So you say SELECT 1.0 + NULL already was DECIMAL(3,1), but when used in
VALUES the result was different?
--
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]