Uh oh!
There was an error while loading. Please reload this page.
[SPARK-30048][SQL] Enable aggregates with interval type values for RelationalGroupedDataset - #26681
[SPARK-30048][SQL] Enable aggregates with interval type values for RelationalGroupedDataset#26681yaooqinn wants to merge 6 commits into
Conversation
…lationalGroupedDataset
yaooqinn
commented
Nov 26, 2019
cc @cloud-fan@maropu@HyukjinKwon@wangyum, thanks for reviewing. |
| colNames.map { colName => | ||
| val namedExpr = df.resolve(colName) | ||
| if (!namedExpr.dataType.isInstanceOf[NumericType]) { | ||
| if (!TypeCollection.NumericAndInterval.acceptsType(namedExpr.dataType)) { |
There was a problem hiding this comment.
Can you update the comment to make it more general one?
There was a problem hiding this comment.
thanks for your suggestion. Please check 。
| schema.fields.filter{ f => | ||
| TypeCollection.NumericAndInterval.acceptsType(f.dataType) | ||
| }.map { n => | ||
| queryExecution.analyzed.resolveQuoted(n.name, sparkSession.sessionState.analyzer.resolver).get |
There was a problem hiding this comment.
nit: we can do
queryExecution.analyzed.output.filter { attr =>
TypeCollection.NumericAndInterval.acceptsType(attr.dataType)
}
SparkQA
commented
Nov 26, 2019
Test build #114462 has finished for PR 26681 at commit
|
SparkQA
commented
Nov 26, 2019
Test build #114469 has finished for PR 26681 at commit
|
SparkQA
commented
Nov 26, 2019
Test build #114472 has finished for PR 26681 at commit
|
SparkQA
commented
Nov 27, 2019
Test build #114499 has finished for PR 26681 at commit
|
SparkQA
commented
Nov 27, 2019
Test build #114519 has finished for PR 26681 at commit
|
SparkQA
commented
Dec 2, 2019
Test build #114731 has finished for PR 26681 at commit
|
maropu
commented
Dec 2, 2019
cloud-fan
commented
Dec 3, 2019
thanks, merging to master! |
…lationalGroupedDataset ### What changes were proposed in this pull request? Now the min/max/sum/avg are support for intervals, we should also enable it in RelationalGroupedDataset ### Why are the changes needed? API consistency improvement ### Does this PR introduce any user-facing change? yes, Dataset support min/max/sum/avg(mean) on intervals ### How was this patch tested? add ut Closesapache#26681 from yaooqinn/SPARK-30048. Authored-by: Kent Yao <yaooqinn@hotmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
### What changes were proposed in this pull request? As we are not going to follow ANSI to implement year-month and day-time interval types, it is weird to compare the year-month part to the day-time part for our current implementation of interval type now. Additionally, the current ordering logic comes from PostgreSQL where the implementation of the interval is messy. And we are not aiming PostgreSQL compliance at all. THIS PR will revert #26681 and #26337 ### Why are the changes needed? make interval type more future-proofing ### Does this PR introduce any user-facing change? there are new in 3.0, so no ### How was this patch tested? existing uts shall work Closes#27262 from yaooqinn/SPARK-30551. Authored-by: Kent Yao <yaooqinn@hotmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Now the min/max/sum/avg are support for intervals, we should also enable it in RelationalGroupedDataset
Why are the changes needed?
API consistency improvement
Does this PR introduce any user-facing change?
yes, Dataset support min/max/sum/avg(mean) on intervals
How was this patch tested?
add ut