[ https://issues.apache.org/jira/browse/DRILL-7139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Hou updated DRILL-7139: ------------------------------ Description: 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',107374,'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',107375,'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} was: 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} > Date_add() can produce 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 > Priority: Major > > 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',107374,'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',107375,'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)