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

Anton Haidai commented on CALCITE-3675:
---------------------------------------

Hello, [~donnyzone]. Thank you for your PR, no code changes form my side.

> SQL to Rel conversion is broken for coalesce on nullable field
> --------------------------------------------------------------
>
>                 Key: CALCITE-3675
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3675
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Anton Haidai
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Reproducible in master (06ac187a342f82a4b69e4c752ccdce0c269a350d): 
> 1.22.0-SNAPSHOT
> SqlToRelConverterTest:
> {code}
>   @Test public void testCoalesceOnNullableField() {
>     final String sql = "select coalesce(mgr, 0) from emp";
>     sql(sql).ok();
>   }
> {code}
> Error:
> {code}
> Conversion to relational algebra failed to preserve datatypes:
> validated type:
> RecordType(INTEGER NOT NULL EXPR$0) NOT NULL
> converted type:
> RecordType(INTEGER EXPR$0) NOT NULL
> rel:
> LogicalProject(EXPR$0=[CASE(IS NOT NULL($3), $3, 0)])
>   LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to