mihaibudiu commented on code in PR #4102:
URL: https://github.com/apache/calcite/pull/4102#discussion_r1893529943
##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -4480,7 +4480,7 @@ private void checkNegWindow(String s, String msg) {
expr("(1,2) in ((1,2), (3,4))")
.columnType("BOOLEAN NOT NULL");
expr("'medium' in (cast(null as varchar(10)), 'bc')")
- .columnType("BOOLEAN NOT NULL");
Review Comment:
I suspect is affects many programs, but there a few reasons we don't see
this:
- this affects only some subexpressions, but often the final expression in a
Project has the same type
- many program representations do not display the types of subexpressions
- the Enumerable representation is in Java, where all Objects are nullable
- there aren't enough tests with complex expressions and null values
Our runtime is written in Rust, and there are separate types for
non-nullable (`T`) and nullable (`Option<T>`). Many mistakes are caught at
compile-time. Other mistakes that are not caught at compile-time become panics
at runtime due to unwrap() calls on Option objects. In Java both of these may
be silent.
It's not easy to write good tests to catch these problems. I think adding
more tests like the one that has failed has value, but only limited value.
--
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]