Uh oh!
There was an error while loading. Please reload this page.
[SPARK-19851] Add support for EVERY and ANY (SOME) aggregates - #22047
[SPARK-19851] Add support for EVERY and ANY (SOME) aggregates#22047dilipbiswal wants to merge 13 commits into
Conversation
dilipbiswal
commented
Aug 8, 2018
@gatorsmile I tried to implement the rewrites suggested in the original PR. It does not seem very straightforward to me. The basic issue is, we are unable to replace the aggregate expression to a scalar expression over aggregates. We only support limited number of true aggregate expressions under window. For example -we are unable to rewrite . to I tried a similar frame work to replace aggregate expressions like |
SparkQA
commented
Aug 8, 2018
Test build #94456 has finished for PR 22047 at commit
|
SparkQA
commented
Aug 9, 2018
Test build #94459 has finished for PR 22047 at commit
|
HyukjinKwon
commented
Aug 10, 2018
There was a problem hiding this comment.
@HyukjinKwon Not sure why.. when i did a build/sbt doc , i got an error here. Thats the reason i had to fix.
There was a problem hiding this comment.
nit: previous indentation was correct.
SparkQA
commented
Aug 10, 2018
Test build #94586 has finished for PR 22047 at commit
|
SparkQA
commented
Aug 11, 2018
Test build #94588 has finished for PR 22047 at commit
|
dilipbiswal
commented
Aug 11, 2018
retest this please |
SparkQA
commented
Aug 11, 2018
Test build #94602 has finished for PR 22047 at commit
|
SparkQA
commented
Oct 2, 2018
Test build #96872 has finished for PR 22047 at commit
|
Let me post something I wrote recently. Could you add test cases to ensure that we do not break the "Ignore NULLs" policy
|
dilipbiswal
commented
Oct 3, 2018
@gatorsmile Thanks.. I will check. |
dilipbiswal
commented
Oct 5, 2018
@gatorsmile First of all, thank you very much . Actually the added aggregates weren't null filtering. I have fixed the issue and have added additional test cases. Thank you. |
SparkQA
commented
Oct 5, 2018
Test build #96968 has finished for PR 22047 at commit
|
dilipbiswal
commented
Oct 5, 2018
retest this please |
SparkQA
commented
Oct 5, 2018
Test build #96978 has finished for PR 22047 at commit
|
cloud-fan
commented
Oct 5, 2018
is it possible to rewrite these 3 new functions with existing expression? e.g. |
dilipbiswal
commented
Oct 5, 2018
@cloud-fan please see my comment link. I had tried to rewrite using max and min as suggested by Herman and Reynold in the original pr. I was unable to do it when the aggregate is part of the window. |
SparkQA
commented
Oct 5, 2018
Test build #96995 has finished for PR 22047 at commit
|
| return Column(jc) | ||
| def every(col): |
There was a problem hiding this comment.
Please keep the SQL functions and remove the function APIs. Thanks!
There was a problem hiding this comment.
@gatorsmile Hi Sean, I have prepared two branches. One in which these new aggregate functions are extending from the base Max and Min class basically reusing code. The other in which we replace these aggregate expressions in the optimizer. Below are the links.
I would prefer option 1 because of the following reasons.
- Code changes are simpler
- Supports these aggregates as window expressions naturally. In the other option i have
to block it. - It seems to me for these simple mapping, we probably don't need a rewrite frame work. We could add it in the future if we need a little complex transformation.
Please let me know how we want to move forward with this. Thanks !!
There was a problem hiding this comment.
@cloud-fan Thank you very much for your response. I will create a new PR based on option-1 today and close this one.
SparkQA
commented
Oct 22, 2018
Test build #97731 has finished for PR 22047 at commit
|
SparkQA
commented
Oct 22, 2018
Test build #97710 has finished for PR 22047 at commit
|
SparkQA
commented
Oct 22, 2018
Test build #97798 has finished for PR 22047 at commit
|
| import org.apache.spark.sql.types._ | ||
| @ExpressionDescription( | ||
| usage = "_FUNC_(expr) - Returns true if at least one value of `expr` is true.") |
There was a problem hiding this comment.
BTW, don't forget to add since.
What changes were proposed in this pull request?
This PR is a rebased version of original work link by
@ptkool.
Please give credit to @ptkool for this work.
Description from original PR:
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.