cloud-fan commented on code in PR #57826:
URL: https://github.com/apache/spark/pull/57826#discussion_r3759069016
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExpandBenchmark.scala:
##########
@@ -161,18 +182,63 @@ object ExpandBenchmark extends SqlBasedBenchmark {
|GROUP BY user_id""".stripMargin
}
+ /**
+ * Measures a traffic/BI "N-day active users" rollup (see
[[conditionalAggsQuery]])
+ * under all four combinations of the two optimizations that affect the
shared
+ * `daysSince` subexpression in the Expand branches:
+ * - base: rewriteCountDistinctConditional off, subexpression elimination
off
+ * -> 10 Expand branches (one per conditional COUNT(DISTINCT) plus one for
+ * the SUMs), daysSince evaluated 18 times per input row;
+ * - +rewrite: rewriteCountDistinctConditional on, CSE off -> the 9
+ * conditional COUNT(DISTINCT) collapse into one distinct group, so the
Review Comment:
**Nit:**
```suggestion
* conditional COUNT(DISTINCT) expressions collapse into one distinct
group, so the
```
--
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]