You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Sean Hsuan-Yi Chu (JIRA)" <ji...@apache.org> on 2016/05/03 19:02:13 UTC

[jira] [Commented] (DRILL-4642) Let RexBuilder.ensureType() mechanism take place during Rex conversion.

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

Sean Hsuan-Yi Chu commented on DRILL-4642:
------------------------------------------

Drill PR: https://github.com/apache/drill/pull/489
Calcite: https://github.com/hsuanyi/incubator-calcite/tree/DRILL-4642

Note the calcite change above cannot be pushed back to apache calcite since it is a followup patch in DrillCalcite, titled

"[StarColumn] Support select * from schema-less table in execution engine like Drill. Include support for view, subquery, CTE.  Enable Drill's support of select * in View, SubQuery, CTE.  Skip expanding expression in with clause in Expander visitor."

> Let RexBuilder.ensureType() mechanism take place during Rex conversion.
> -----------------------------------------------------------------------
>
>                 Key: DRILL-4642
>                 URL: https://issues.apache.org/jira/browse/DRILL-4642
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Sean Hsuan-Yi Chu
>            Assignee: Sean Hsuan-Yi Chu
>             Fix For: 1.7.0
>
>
> In DRILL-4372, the logic of ensuring same type is removed since, in some case such as below, undesirable cast function will be added and cause failure.
> {code}
> SELECT * 
> FROM T 
> WHERE (cast(col1 as timestamp)  - to_timestamp(col2,'YYYY-MM-dd HH:mm:ss') < interval 'X XX:XX:XX' day to second)
> {code}
> The fundamental reason for this behavior roots in Drill-Calcite [1], where SqlNode WHERE is expanded to a new object but is not passed into validation step.
> [1] https://github.com/mapr/incubator-calcite/blob/DrillCalcite1.4.0-mapr-1.4.0/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3362



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)