Github user ooq commented on the issue:
https://github.com/apache/spark/pull/14174
hey @sameeragarwal, the diff of the generated code can be found here (with
the left side for vectorized hashmap and right side for the new, row-based
one):
https://gist.github.com/ooq/d25d4de4c445752c6e1a810262c2e5c1/revisions?diff=split
Below is my code to generate them:
```
test("generated code comparison for vectorized vs. rowbased") {
val N = 20 << 23
sparkSession.conf.set("spark.sql.codegen.wholeStage", "true")
sparkSession.conf.set("spark.sql.codegen.aggregate.map.columns.max",
"30")
sparkSession.range(N)
.selectExpr(
"id & 1023 as k1",
"cast (id & 1023 as string) as k2")
.createOrReplaceTempView("test")
// dataframe/query
val query = sparkSession.sql("select count(k1), sum(k1) from test group
by k1, k2")
// vectorized
sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl",
"vectorized")
query.queryExecution.debug.codegen()
// row based
sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl",
"rowbased")
query.queryExecution.debug.codegen()
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]