You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jess Balint (Jira)" <ji...@apache.org> on 2023/02/07 22:34:01 UTC

[jira] [Closed] (CALCITE-5466) Constant condition can't be reduced after correlate

     [ https://issues.apache.org/jira/browse/CALCITE-5466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jess Balint closed CALCITE-5466.
--------------------------------

Resolved in release 1.33.0 (2023-02-06)

> Constant condition can't be reduced after correlate
> ---------------------------------------------------
>
>                 Key: CALCITE-5466
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5466
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Aitozi
>            Assignee: Aitozi
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.33.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Currently the RelMdPredicates do not handle the predicates for the correlate node which will generate the below output 
> {noformat}
> Sink(table=[default_catalog.default_database.sink_t], fields=[name, num])
> +- Calc(select=[name, CAST(CASE(=(__source_type__, _UTF-16LE'bounded'), 1, 2) AS BIGINT) AS num])
>    +- Correlate(invocation=[test_udtf($cor1.name)], correlate=[table(test_udtf($cor1.name))], select=[name,__source_type__,EXPR$0], rowType=[RecordType(VARCHAR(2147483647) name, CHAR(7) __source_type__, VARCHAR(2147483647) EXPR$0)], joinType=[INNER])
>       +- Calc(select=[name, _UTF-16LE'bounded' AS __source_type__])
>          +- TableSourceScan(table=[[default_catalog, default_database, source_t]], fields=[name])
> {noformat}
> However, the '__source_type__' is obviously a constant can be reduced during optimizing. It can be solved by extend the RelMdPredicates to get predicates from the left input of the correlate node



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