Github user wangyum commented on a diff in the pull request:
https://github.com/apache/spark/pull/22484#discussion_r220028846
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala
---
@@ -73,23 +73,26 @@ object AggregateBenchmark extends SqlBasedBenchmark {
spark.range(N).selectExpr("(id & 65535) as
k").groupBy("k").sum().collect()
}
- benchmark.addCase(s"codegen = F", numIters = 2) { iter =>
- spark.conf.set("spark.sql.codegen.wholeStage", "false")
- f()
+ benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
+ withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key ->
false.toString) {
+ f()
+ }
}
- benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { iter =>
- spark.conf.set("spark.sql.codegen.wholeStage", "true")
- spark.conf.set("spark.sql.codegen.aggregate.map.twolevel.enabled",
"false")
-
spark.conf.set("spark.sql.codegen.aggregate.map.vectorized.enable", "false")
- f()
+ benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
+ withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key ->
true.toString,
+ SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> false.toString,
+ "spark.sql.codegen.aggregate.map.vectorized.enable" ->
false.toString) {
--- End diff --
Do you mean change
```scala
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
"spark.sql.codegen.aggregate.map.vectorized.enable" -> "false") {
f()
}
```
to
```scala
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
"spark.sql.codegen.aggregate.map.vectorized.enable" -> "false") {
f()
}
```
?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]