[
https://issues.apache.org/jira/browse/DRILL-4722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064548#comment-16064548
]
ASF GitHub Bot commented on DRILL-4722:
---------------------------------------
GitHub user vvysotskyi opened a pull request:
https://github.com/apache/drill/pull/861
DRILL-4722: Fix EqualityVisitor for interval day expressions with millis
Please see the problem description in
[DRILL-4722](https://issues.apache.org/jira/browse/DRILL-4722)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/vvysotskyi/drill DRILL-4722
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/861.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #861
----
----
> Fix EqualityVisitor for interval day expressions with millis
> ------------------------------------------------------------
>
> Key: DRILL-4722
> URL: https://issues.apache.org/jira/browse/DRILL-4722
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Reporter: Krystal
> Assignee: Volodymyr Vysotskyi
> Fix For: 1.11.0
>
>
> *Issue*
> The following query returns the same data for the second column as the first:
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '3'
> HOUR), date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '5'
> HOUR) from (values(1));
> +------------------------+------------------------+
> | EXPR$0 | EXPR$1 |
> +------------------------+------------------------+
> | 2015-01-24 10:27:05.0 | 2015-01-24 10:27:05.0 |
> +------------------------+------------------------+
> {code}
> If each column is run separately, then it produces correct result:
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '3'
> HOUR) from (values(1));
> +------------------------+
> | EXPR$0 |
> +------------------------+
> | 2015-01-24 10:27:05.0 |
> +------------------------+
> {code}
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '5'
> HOUR) from (values(1));
> +------------------------+
> | EXPR$0 |
> +------------------------+
> | 2015-01-24 12:27:05.0 |
> +------------------------+
> {code}
> Same problem is seen for interval of minute and second:
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '50'
> MINUTE), date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '40'
> MINUTE) from (values(1));
> +------------------------+------------------------+
> | EXPR$0 | EXPR$1 |
> +------------------------+------------------------+
> | 2015-01-24 08:17:05.0 | 2015-01-24 08:17:05.0 |
> +------------------------+------------------------+
> {code}
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '50'
> second), date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '40'
> second) from (values(1));
> +------------------------+------------------------+
> | EXPR$0 | EXPR$1 |
> +------------------------+------------------------+
> | 2015-01-24 07:27:55.0 | 2015-01-24 07:27:55.0 |
> +------------------------+------------------------+
> {code}
> {code:sql}
> select date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '3'
> HOUR), date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '50'
> MINUTE), date_add(cast('2015-01-24 07:27:05.0' as timestamp), interval '50'
> second) from (values(1));
> +------------------------+------------------------+------------------------+
> | EXPR$0 | EXPR$1 | EXPR$2 |
> +------------------------+------------------------+------------------------+
> | 2015-01-24 10:27:05.0 | 2015-01-24 10:27:05.0 | 2015-01-24 10:27:05.0 |
> +------------------------+------------------------+------------------------+
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)