[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16244320#comment-16244320 ] Anton Kedin commented on BEAM-2203: --- To summarize, implemented operations so far: * TIMESTAMPADD(timeUnit, numer, interval) * timestamp + interval * TIMESTAMPDIFF(timeUnit, timestampStart, timestampEnd) * timestamp - interval > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16243429#comment-16243429 ] ASF GitHub Bot commented on BEAM-2203: -- Github user asfgit closed the pull request at: https://github.com/apache/beam/pull/4082 > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16242245#comment-16242245 ] ASF GitHub Bot commented on BEAM-2203: -- Github user asfgit closed the pull request at: https://github.com/apache/beam/pull/4065 > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240713#comment-16240713 ] Anton Kedin commented on BEAM-2203: --- Also, it looks like infix 'timestamp - timestamp' is also not supported by Calcite: {code} CalciteContextException: From line 1, column 8 to line 1, column 72: Cannot apply '-' to arguments of type ' - '. Supported form(s): ' - ' ' - ' ' - ' {code} > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240696#comment-16240696 ] Anton Kedin commented on BEAM-2203: --- Pausing the work on 'interval - interval' use case. The expected behavior is not clear at the moment. > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240575#comment-16240575 ] Anton Kedin commented on BEAM-2203: --- 'timestamp - interval' implementation: https://github.com/apache/beam/pull/4082 > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240573#comment-16240573 ] ASF GitHub Bot commented on BEAM-2203: -- GitHub user akedin opened a pull request: https://github.com/apache/beam/pull/4082 [BEAM-2203] Subtraction 'timestamp - interval' Currently this also includes commits from https://github.com/apache/beam/pull/4065/ Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- You can merge this pull request into a Git repository by running: $ git pull https://github.com/akedin/beam timestamp_minus_interval Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/4082.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 #4082 commit c2c283cf9bda446c37874f0af9d43e52e90b6dd8 Author: Anton Kedin Date: 2017-10-31T00:36:21Z [BEAM-2203] Implement Reinterprent from integer types to BigInt Split Reinterpret call implementation into multiple classes. Add implementation for INT_TYPES->BIGINT conversion. This is needed for TIMESTAMPDIFF() implementation, Calcilte converts 'TIMESTAMPDIFF(timeUnit, dateStart, dateEnd)' to 'CAST(/INT(Reinterpret(-(dateEnd, dateStart)), timeUnit.multiplier)):INTEGER NOT NULL' commit 7be44848e8a5c90ce3d1d764a2d2a3bdd7f84a72 Author: Anton Kedin Date: 2017-10-31T00:42:29Z [BEAM-2203] Implement TIMESTAMPDIFF() Add BeamSqlDateTimeMinus expression, which implements only TIMESTAMPDIFF(). Other supported 'datetime minus' variants are not implemented here. commit 72225ce421db4a108bbc9fb10bd7d545f9e8b089 Author: Anton Kedin Date: 2017-11-02T03:22:04Z fixup! [BEAM-2203] Implement TIMESTAMPDIFF() commit 4900a32c5a4f95d5bf38340811e6c07b7ea06e99 Author: Anton Kedin Date: 2017-11-02T17:20:03Z fixup! fixup! [BEAM-2203] Implement TIMESTAMPDIFF() commit 5828f9b16adbdd52d0b635f842fba510f6923e3a Author: Anton Kedin Date: 2017-11-06T07:26:10Z [BEAM-2203] Implement 'timestamp - interval' Move TIMESTAMPDIFF implementation into BeamSqlTimestampMinusTimestampExpression, add BeamSqlTimestampMinusIntervalExpression > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16234957#comment-16234957 ] ASF GitHub Bot commented on BEAM-2203: -- Github user asfgit closed the pull request at: https://github.com/apache/beam/pull/4052 > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin >Priority: Major > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16227549#comment-16227549 ] Anton Kedin commented on BEAM-2203: --- TIMESTAMPDIFF() PR: https://github.com/apache/beam/pull/4065/ > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16222828#comment-16222828 ] Anton Kedin commented on BEAM-2203: --- TIMESTAMPADD() PR: https://github.com/apache/beam/pull/4052 > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Anton Kedin > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16217810#comment-16217810 ] Anton Kedin commented on BEAM-2203: --- I'm going to pick this up. Let me know if you're working on this. > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Kai Jiang > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16217165#comment-16217165 ] Kenneth Knowles commented on BEAM-2203: --- [~vectorijk] are you still working on this, or can we make it available? > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Kai Jiang > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079880#comment-16079880 ] Xu Mingmin commented on BEAM-2203: -- not sure {{-}}, {{\+}} for date is converted to {{+($1, 1000)}}, here $1 is a field with type {{TIMESTAMP}}, and {{1000}} has a type of {{SqlTypeName.INTERVAL_TYPES}} with a bigdecimal value in millisecond. I think it's not related with TIMESTAMPADD/TIMESTAMPDIFF, or maybe the two functions are converted to {{\+}} {{\-}} in Calcite. > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Kai Jiang > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079805#comment-16079805 ] James Xu commented on BEAM-2203: I have assigned this one to you [~vectorijk] > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu >Assignee: Kai Jiang > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079517#comment-16079517 ] Kai Jiang commented on BEAM-2203: - [~xumingming] I would take a try on this one. Should we implement these two first? TIMESTAMPADD(timeUnit, integer, datetime) TIMESTAMPDIFF(timeUnit, datetime, datetime2) > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu > -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (BEAM-2203) Arithmetic operators: support DATETIME & DATETIME_INTERVAL
[ https://issues.apache.org/jira/browse/BEAM-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011762#comment-16011762 ] James Xu commented on BEAM-2203: `+`, `-` has not been implemented for Date: https://calcite.apache.org/docs/reference.html#datetime-functions > Arithmetic operators: support DATETIME & DATETIME_INTERVAL > -- > > Key: BEAM-2203 > URL: https://issues.apache.org/jira/browse/BEAM-2203 > Project: Beam > Issue Type: New Feature > Components: dsl-sql >Reporter: James Xu > -- This message was sent by Atlassian JIRA (v6.3.15#6346)