[
https://issues.apache.org/jira/browse/DRILL-4642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15271455#comment-15271455
]
ASF GitHub Bot commented on DRILL-4642:
---------------------------------------
Github user hsuanyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/489#discussion_r62117505
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/TestFunctionsWithTypeExpoQueries.java
---
@@ -213,7 +221,7 @@ public void tesIsNull() throws Exception {
List<Pair<SchemaPath, TypeProtos.MajorType>> expectedSchema =
Lists.newArrayList();
TypeProtos.MajorType majorType = TypeProtos.MajorType.newBuilder()
.setMinorType(TypeProtos.MinorType.BIT)
- .setMode(TypeProtos.DataMode.REQUIRED)
+ .setMode(TypeProtos.DataMode.OPTIONAL)
--- End diff --
In fact, I meant to let the tests in this test-suite run with Limit-0
optimization. However, that option is off by default. So I added
https://github.com/apache/drill/pull/489/files#diff-0e0d4b8f1e54d2a7e8b6bc04d8606bf7R35
However, that exposed an issue here:
https://issues.apache.org/jira/browse/DRILL-4656
So I think we should firstly turn this test off until we fix DRILL-4656
> 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)