Re: ProjectReduceExpressionsRule vs matchNullability: should RelRule be allowed to change field nullability?

2020-11-09 Thread Julian Hyde
Probably RelRule should not change nullability. But we have done so in the past, and I suspect we continue to do so today. It would be interesting to find a list of rules that do this. Deducing that a field is never null is very useful. With that knowledge, further optimizations become possible. S

ProjectReduceExpressionsRule vs matchNullability: should RelRule be allowed to change field nullability?

2020-11-08 Thread Vladimir Sitnikov
Hi, Can anybody clarify if RelRule should be allowed to change RelNode field nullability? For instance, RelOptRulesTest#testReduceNullableToNotNull has the following SQL: ...empno + *case* when 'a' = 'a' then 1 else *null end* as newcol... Of course, the initial type is nullable int (since the l