GitHub user akedin opened a pull request:
https://github.com/apache/beam/pull/4065
Timestamp diff implementation
Implements TIMESTAMPDIFF() call. Does not implement other datetime
subtraction types.
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_diff
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/4065.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 #4065
----
commit 551bc635f0bece04ddf32bb883f0f9bc18c1b853
Author: Anton Kedin <[email protected]>
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 6a9861c7740695204469d9d7d78e3bda5cf34f45
Author: Anton Kedin <[email protected]>
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.
----
---