-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tree: fix H:M:S related bugs for intervals #43924
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
solongordon
approved these changes
Jan 22, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @solongordon)
bors r=solongordon |
Build failed |
a97de90
to
c68049b
Compare
In addition to the release note below, this change also cleans up some of the logic deferring duration parsing from `time.ParseDuration` to processing the components ourselves. The extensive unit tests, along with additions, should cover any regressions. Release note (sql change): * This change introduces support having D:H:M, D:M:S.fff or D:H:M:S.fff for interval parsing if the first element is a decimal or empty, e.g. `:04:05` and `1.0:04:05` would be `04:05:00` and `1 day 04:05:00` respectively. * Furthermore, we previously supported having floats in H:M:S formats, e.g. "1.0:2.0:3.0" -- which doesn't really make sense. This PR no longer allows the M field to be float.
bors r=solongordon looks like remaining failure is a flake on CI |
craig bot
pushed a commit
that referenced
this pull request
Jan 22, 2020
43923: duration,builtins: fix interval cast involving years to match postgres r=solongordon a=otan Refs: #43272 Release note (sql change, backward-incompatible change): Previously, intervals could be cast to integers and floats. However, this relies on a year being 365 days. To match `extract('epoch' from interval)` behavior in postgres/cockroach having a year being 365.25 days, we accordingly the cast to int and floats have years valued at 365.25 days in seconds instead of 365. 43924: tree: fix H:M:S related bugs for intervals r=solongordon a=otan Resolves #43317. In addition to the release note below, this change also cleans up some of the logic deferring duration parsing from `time.ParseDuration` to processing the components ourselves. The extensive unit tests, along with additions, should cover any regressions. Release note (sql change): * This change introduces support having D:H:M, D:M:S.fff or D:H:M:S.fff for interval parsing if the first element is a decimal or empty, e.g. `:04:05` and `1.0:04:05` would be `04:05:00` and `1 day 04:05:00` respectively. * Furthermore, we previously supported having floats in H:M:S formats, e.g. "1.0:2.0:3.0" -- which doesn't really make sense. This PR no longer allows the M field to be float. 44042: sql: introduce localtime and localtimestamp functionality r=solongordon a=otan Resolves #44032. Note: a lack of implicit casts here hurt us and make us have to return every permutation of time(stamp) / time(stamp)tz. Release note (sql change): * This PR introduces `localtime`, which by default returns the current time as the `time` data type (as opposed to `current_time`, which returns the `timetz` data type). * This PR introduces `localtimestamp`, which by default returns the current timestamp as the `timestamp` data type (as opposed to `current_timestamp`, which returns the `timestamptz` data type). Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Build succeeded |
SQL Features (Deprecated - use SQL Experience board)
automation
moved this from Open PRs
to Done
Jan 22, 2020
This was referenced Feb 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #43317.
In addition to the release note below, this change also cleans up some
of the logic deferring duration parsing from
time.ParseDuration
toprocessing the components ourselves. The extensive unit tests, along
with additions, should cover any regressions.
Release note (sql change):
for interval parsing if the first element is a decimal or empty, e.g.
:04:05
and1.0:04:05
would be04:05:00
and1 day 04:05:00
respectively.
e.g. "1.0:2.0:3.0" -- which doesn't really make sense. This PR no longer
allows the M field to be float.