You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/03/02 04:46:00 UTC

[jira] [Commented] (CALCITE-2888) Enhance RexImplicationChecker to better handle filters with CAST

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

Danny Chan commented on CALCITE-2888:
-------------------------------------

Broadly, i am a little confused why you need to modify the RexImplicationChecker  to use RexExecutor reduce the constant expression  with Cast, e.g. Cast('1bc', DATE), why don't you just use ReduceExpressionRule to reduce the constant first then ? So in what case have such error, can you please give an example ?

> Enhance RexImplicationChecker to better handle filters with CAST
> ----------------------------------------------------------------
>
>                 Key: CALCITE-2888
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2888
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Juhwan Kim
>            Assignee: Juhwan Kim
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> I saw some cases where RexImplicationChecker gave an AssertionError when CAST was involved in the filters.
> For example, if a filter is
> '>(CAST(SOME_VHARCHAR_INPUT_REF, DATE), SOME_DATE_LITERAL)',
> currently, it removes CAST first and tries to convert DATE literal to VARCHAR type,
> which is not supported, and runtime AssertionError is thrown during implication checking.
> I think the issue can be solved by using RexExecutor's reduce function before removing cast from literal side. Also, allowing other implementations of RexExecutor would make it more flexible. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)