cloud-fan commented on a change in pull request #26681: [SPARK-30048][SQL]
Enable aggregates with interval type values for RelationalGroupedDataset
URL: https://github.com/apache/spark/pull/26681#discussion_r350798860
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
##########
@@ -268,8 +268,10 @@ class Dataset[T] private[sql](
}
}
- private[sql] def numericColumns: Seq[Expression] = {
- schema.fields.filter(_.dataType.isInstanceOf[NumericType]).map { n =>
+ private[sql] def numericCalculationSupportedColumns: Seq[Expression] = {
+ schema.fields.filter{ f =>
+ TypeCollection.NumericAndInterval.acceptsType(f.dataType)
+ }.map { n =>
queryExecution.analyzed.resolveQuoted(n.name,
sparkSession.sessionState.analyzer.resolver).get
Review comment:
nit: we can do
```
queryExecution.analyzed.output.filter { attr =>
TypeCollection.NumericAndInterval.acceptsType(attr.dataType)
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]