Corrected Strict NON NULL return type checks#16279
Conversation
| .operandTypes(SqlTypeFamily.CHARACTER, SqlTypeFamily.INTEGER, SqlTypeFamily.INTEGER) | ||
| .functionCategory(SqlFunctionCategory.STRING) | ||
| .returnTypeInference(ReturnTypes.ARG0) | ||
| .returnTypeInference(ReturnTypes.ARG0.andThen(SqlTypeTransforms.FORCE_NULLABLE)) |
There was a problem hiding this comment.
afaik these are appied during calcite planning ; I see some tests in ExpressionTest ; aren't those only excercise the native layer?
| makeExpression("substring(\"spacey\", (\"p\" - 1), \"p\")"), | ||
| "hey" | ||
| ); | ||
| testHelper.testExpressionString( |
There was a problem hiding this comment.
I've unpatched all non-test changes - and these cases still pass...did I miss something?
There was a problem hiding this comment.
I guess these tests here are only running on the native layer. And the issue which we face is more of coming in the calcite layer. Let me change the tests. Thanks for pointing these.
Moreover
select CONTAINS_STRING(null, 'a') -- gives INVALID use of null
select CONTAINS_STRING(dim3, 'a') from numFoo where dim3 is null -- fails the strict check
kgyrtkirk
left a comment
There was a problem hiding this comment.
some minor test related notes
Description
aims to fix strict type compare issue (Boolean vs Boolean not null) in TIME_IN_INTERVAL
Key changed/added classes in this PR
TimeInIntervalConvertletFactory.javaContainsOperatorConversion.javaRegexpLikeOperatorConversion.javaSubstringOperatorConversion.javaThis PR has: