Skip to content

[SPARK-19851] Add support for EVERY and ANY (SOME) aggregates - #17648

Closed
ptkool wants to merge 8 commits into
apache:masterfrom
ptkool:every_any_aggregates
Closed

[SPARK-19851] Add support for EVERY and ANY (SOME) aggregates#17648
ptkool wants to merge 8 commits into
apache:masterfrom
ptkool:every_any_aggregates

Conversation

@ptkool

@ptkoolptkool commented Apr 16, 2017

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This pull request implements the EVERY and ANY aggregates.

How was this patch tested?

Testing was performed using unit tests, integration tests, and manual tests.

@ptkoolptkool changed the title Every any aggregates[SPARK-19851] Add support for EVERY and ANY (SOME) aggregatesApr 16, 2017
@ptkool

Copy link
Copy Markdown
ContributorAuthor

Moved this PR to a feature branch and lost comments. The original PR is here: #17194

@rxin

rxin commented Apr 18, 2017

Copy link
Copy Markdown
Contributor

Can we just do a logical rewrite to turn them into "condA + condB + condC > 0" (for Some/Any) and "condA + condB + condC = 3" for Every?

@ptkool

Copy link
Copy Markdown
ContributorAuthor

@rxin I'm not sure where you're going with your proposal. These are aggregate functions, not scalar functions.

@rxin

rxin commented Apr 21, 2017

Copy link
Copy Markdown
Contributor

I was saying rather than implementing them, just rewrite them into an aggregate on the conditions and compare them against the value.

@ptkool

Copy link
Copy Markdown
ContributorAuthor

@rxin Ok. So you're proposing rewrites for these aggregates that look something like this?

some(cond) => sum(cond) > 0
every(cond) => sum(not(cond)) = 0

@ptkool

Copy link
Copy Markdown
ContributorAuthor

@rxin Actually, @hvanhovell proposed the following rewrites which I think are better:

some(cond) => max(cond) = true
every(cond) => min(cond) = true

@rxin

rxin commented Apr 24, 2017

Copy link
Copy Markdown
Contributor

sgtm

@gatorsmile

Copy link
Copy Markdown
Member

@ptkool Could you address the comments and we can review it? Thanks!

@ptkool
ptkoolforce-pushed the every_any_aggregates branch from 97bec05 to e0b5cc6CompareOctober 29, 2017 13:58
@HyukjinKwon

Copy link
Copy Markdown
Member

ok to test

@HyukjinKwon

Copy link
Copy Markdown
Member

@ptkool mind updating the PR please?

@SparkQA

Copy link
Copy Markdown

Test build #93044 has finished for PR 17648 at commit e0b5cc6.

  • This patch fails to generate documentation.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@gatorsmile

Copy link
Copy Markdown
Member

@dilipbiswal Could you take this over?

@dilipbiswal

Copy link
Copy Markdown
Contributor

@gatorsmile Sure.

@gatorsmile

Copy link
Copy Markdown
Member

@ptkool Thanks for your contribution! This feature will be available in the next release. Spark 3.0

@ptkool
ptkool deleted the every_any_aggregates branch January 18, 2020 12:14
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closesapache#21766Closesapache#21679Closesapache#21161Closesapache#20846Closesapache#19434Closesapache#18080Closesapache#17648Closesapache#17169
Add:
Closesapache#22813Closesapache#21994Closesapache#22005Closesapache#22463
Add:
Closesapache#15899
Add:
Closesapache#22539Closesapache#21868Closesapache#21514Closesapache#21402Closesapache#21322Closesapache#21257Closesapache#20163Closesapache#19691Closesapache#18697Closesapache#18636Closesapache#17176Closesapache#23001 from wangyum/CloseStalePRs.
Authored-by: Yuming Wang <yumwang@ebay.com>
Signed-off-by: hyukjinkwon <gurwls223@apache.org>
Sign up for freeto 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.

6 participants

@ptkool@rxin@gatorsmile@HyukjinKwon@SparkQA@dilipbiswal