cloud-fan commented on a change in pull request #35273:
URL: https://github.com/apache/spark/pull/35273#discussion_r791325928
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala
##########
@@ -44,8 +42,7 @@ case class SortAggregateExec(
with AliasAwareOutputOrdering {
override lazy val metrics = Map(
- "numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output
rows"),
- "aggTime" -> SQLMetrics.createTimingMetric(sparkContext, "time in
aggregation build"))
Review comment:
unrelated to this PR: the name `aggTime` is a bit misleading. Is it
actually the time to build the hash table?
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/SortAggregateExec.scala
##########
@@ -44,8 +42,7 @@ case class SortAggregateExec(
with AliasAwareOutputOrdering {
override lazy val metrics = Map(
- "numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output
rows"),
- "aggTime" -> SQLMetrics.createTimingMetric(sparkContext, "time in
aggregation build"))
Review comment:
if there is no group col, does `HashAggregate` always report `aggTime`
as 0?
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggregateCodegenSupport.scala
##########
@@ -47,6 +47,12 @@ trait AggregateCodegenSupport
*/
private var bufVars: Seq[Seq[ExprCode]] = _
+ /**
+ * Whether this operator has an aggregate build phase.
+ * Only [[HashAggregateExec]] has build phase now.
+ */
+ protected def hasAggBuild: Boolean
Review comment:
shall we rename it to `needHashTable`? And it should be false in
`HashAggregateExec` if group by col is empty.
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/AggregateCodegenSupport.scala
##########
@@ -47,6 +47,12 @@ trait AggregateCodegenSupport
*/
private var bufVars: Seq[Seq[ExprCode]] = _
+ /**
+ * Whether this operator has an aggregate build phase.
+ * Only [[HashAggregateExec]] has build phase now.
+ */
+ protected def hasAggBuild: Boolean
Review comment:
ok maybe we can do the change in a new PR. Let's just use a proper name
in this PR.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]