You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Robert Hou (JIRA)" <ji...@apache.org> on 2019/03/29 01:24:00 UTC

[jira] [Created] (DRILL-7139) Date)add produces Incorrect results when adding to a timestamp

Robert Hou created DRILL-7139:
---------------------------------

             Summary: Date)add produces Incorrect results when adding to a timestamp
                 Key: DRILL-7139
                 URL: https://issues.apache.org/jira/browse/DRILL-7139
             Project: Apache Drill
          Issue Type: Bug
          Components: Functions - Drill
    Affects Versions: 1.15.0
            Reporter: Robert Hou
            Assignee: Pritesh Maker


I am using date_add() to create a sequence of timestamps:
{noformat}
select date_add(timestamp '1970-01-01 00:00:00', cast(concat('PT',{color:#f79232}107374{color},'M') as interval minute)) timestamp_id from (values(1));
+--------------------------+
|       timestamp_id       |
+--------------------------+
| 1970-01-25 20:31:12.704  |
+--------------------------+
1 row selected (0.121 seconds)
{noformat}

When I add one more, I get an older timestamp:
{noformat}
0: jdbc:drill:drillbit=10.10.51.5> select date_add(timestamp '1970-01-01 00:00:00', cast(concat('PT',{color:#f79232}107375{color},'M') as interval minute)) timestamp_id from (values(1));
+--------------------------+
|       timestamp_id       |
+--------------------------+
| 1969-12-07 03:29:25.408  |
+--------------------------+
1 row selected (0.126 seconds)
{noformat}



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