-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: complete eval functionality for TimeTZ #42687
sql: complete eval functionality for TimeTZ #42687
Conversation
1fcd27c
to
5a70310
Compare
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.
Reviewed 14 of 14 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @otan)
pkg/sql/sem/tree/eval.go, line 611 at r1 (raw file):
return nil, err } t := leftTime.Add(right.(*DTimeTZ).ToTime().Sub(timeutil.Unix(0, 0)))
Minor: The .Sub(timeutil.Unix(0, 0))
bit is a little mysterious. It might be nicer to add a ToDuration
method on TimeOfDay
or something.
c79e5f5
to
f2ffb41
Compare
We want to support all operations that are supported by TimeTZ in postgres: * equality, less than * timetz + date, interval + timetz * timetz + interval, interval + timetz * timetz - interval ``` otan=# select oprname, oprcode from pg_operator where oprleft = 'timetz'::regtype or oprright = 'timetz'::regtype or oprresult = 'timetz'::regtype; oprname | oprcode ---------+-------------------- = | timetz_eq <> | timetz_ne < | timetz_lt <= | timetz_le > | timetz_gt >= | timetz_ge + | datetimetz_pl + | timetzdate_pl + | timetz_pl_interval - | timetz_mi_interval + | interval_pl_timetz (11 rows) ``` Release note: None
f2ffb41
to
d062297
Compare
bors r+ |
Build failed |
bors r+ |
42687: sql: complete eval functionality for TimeTZ r=otan a=otan Refs: #26097 We want to support all operations that are supported by TimeTZ in postgres: * equality, less than * timetz + date, interval + timetz * timetz + interval, interval + timetz * timetz - interval ``` otan=# select oprname, oprcode from pg_operator where oprleft = 'timetz'::regtype or oprright = 'timetz'::regtype or oprresult = 'timetz'::regtype; oprname | oprcode ---------+-------------------- = | timetz_eq <> | timetz_ne < | timetz_lt <= | timetz_le > | timetz_gt >= | timetz_ge + | datetimetz_pl + | timetzdate_pl + | timetz_pl_interval - | timetz_mi_interval + | interval_pl_timetz (11 rows) ``` Release note: None Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Build succeeded |
Refs: #26097
We want to support all operations that are supported by TimeTZ in
postgres:
Release note: None