[ 
https://issues.apache.org/jira/browse/CALCITE-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849889#comment-17849889
 ] 

Mou Wu commented on CALCITE-6422:
---------------------------------

[~julianhyde] OK, I changed the title.

> NPE in RexLiteral.booleanValue of SubstitutionVisitor.mayBeSatisfiable when 
> materialized view query contains NEQ on nullable column
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6422
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6422
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Mou Wu
>            Assignee: Mou Wu
>            Priority: Major
>              Labels: pull-request-available
>
> Add the test case in MaterializedViewRelOptRulesTest to reproduce this bug:
> {code:java}
> @Test public void testNpeInSplitFilterOfSubstitutionVisitor() {
>   sql("select \"col1\", \"col2\""
>           + " from \"nullables\""
>           + " where \"col1\" <> \"col2\" and \"col3\" = 1",
>       "select \"col1\", \"col2\""
>           + " from \"nullables\""
>           + " where \"col1\" = \"col2\" and \"col3\" = 1")
>       .checkingThatResultContains(""
>           + "EnumerableCalc(expr#0..2=[{inputs}], expr#3=[=($t0, $t1)], 
> expr#4=[CAST($t2):INTEGER NOT NULL], expr#5=[1], expr#6=[=($t4, $t5)], 
> expr#7=[AND($t3, $t6)], proj#0..1=[{exprs}], $condition=[$t7])\n"
>           + "  EnumerableTableScan(table=[[hr, nullables]])")
>       .ok();
> } {code}
> A NPE will be thrown.
> Notes: col1 and col2 of table nullables should be nullable.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to