Skip to content
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

builtins: add avg for interval #42457

Merged
merged 1 commit into from
Nov 13, 2019
Merged

Conversation

otan
Copy link
Contributor

@otan otan commented Nov 13, 2019

Resolves #42449
Resolves cockroachdb/django-cockroachdb#72

This PR adds the ability to average intervals. Comes with a few extra
tests for aggregation functions over intervals.

Release note (sql change): Adds the ability to run avg over intervals.

@otan otan requested a review from rafiss November 13, 2019 20:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan requested a review from a team November 13, 2019 20:40
Copy link
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan and @rafiss)


pkg/sql/logictest/testdata/logic_test/aggregate, line 156 at r1 (raw file):

statement OK
INSERT INTO kv VALUES
(1, 2, 3, 'a', '1min'::interval),

Nit: I think the ::interval cast is unnecessary here.

This PR adds the ability to average intervals. Comes with a few extra
tests for aggregation functions over intervals.

Release note (sql change): Adds the ability to run `avg` over intervals.
@otan
Copy link
Contributor Author

otan commented Nov 13, 2019

ty!
bors r+

@otan
Copy link
Contributor Author

otan commented Nov 13, 2019

bors r+

craig bot pushed a commit that referenced this pull request Nov 13, 2019
42457: builtins: add avg for interval r=otan a=otan

Resolves #42449
Resolves cockroachdb/django-cockroachdb#72

This PR adds the ability to average intervals. Comes with a few extra
tests for aggregation functions over intervals.

Release note (sql change): Adds the ability to run `avg` over intervals.

Co-authored-by: Oliver Tan <[email protected]>
@craig
Copy link
Contributor

craig bot commented Nov 13, 2019

Build succeeded

@craig craig bot merged commit ee6c177 into cockroachdb:master Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: support avg() on interval type Unsupported query: unknown signature: avg(interval)
3 participants