Skip to content

Commit 3439992

Browse files
committed
Fix string variable
1 parent 45add92 commit 3439992

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
7373
spark.range(N).selectExpr("(id & 65535) as k").groupBy("k").sum().collect()
7474
}
7575

76-
benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
76+
benchmark.addCase("codegen = F", numIters = 2) { _ =>
7777
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
7878
f()
7979
}
8080
}
8181

82-
benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
82+
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
8383
withSQLConf(
8484
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
8585
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
@@ -88,7 +88,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
8888
}
8989
}
9090

91-
benchmark.addCase(s"codegen = T hashmap = T", numIters = 5) { _ =>
91+
benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ =>
9292
withSQLConf(
9393
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
9494
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
@@ -109,13 +109,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
109109

110110
def f(): Unit = spark.sql("select k, k, sum(id) from test group by k, k").collect()
111111

112-
benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
112+
benchmark.addCase("codegen = F", numIters = 2) { _ =>
113113
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
114114
f()
115115
}
116116
}
117117

118-
benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
118+
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
119119
withSQLConf(
120120
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
121121
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
@@ -124,7 +124,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
124124
}
125125
}
126126

127-
benchmark.addCase(s"codegen = T hashmap = T", numIters = 5) { _ =>
127+
benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ =>
128128
withSQLConf(
129129
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
130130
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
@@ -144,14 +144,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
144144
def f(): Unit = spark.range(N).selectExpr("id", "cast(id & 1023 as string) as k")
145145
.groupBy("k").count().collect()
146146

147-
benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
148-
spark.conf.set("spark.sql.codegen.wholeStage", "false")
147+
benchmark.addCase("codegen = F", numIters = 2) { _ =>
149148
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
150149
f()
151150
}
152151
}
153152

154-
benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
153+
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
155154
withSQLConf(
156155
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
157156
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
@@ -160,7 +159,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
160159
}
161160
}
162161

163-
benchmark.addCase(s"codegen = T hashmap = T", numIters = 5) { _ =>
162+
benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ =>
164163
withSQLConf(
165164
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
166165
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
@@ -180,13 +179,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
180179
def f(): Unit = spark.range(N).selectExpr("id", "cast(id & 65535 as decimal) as k")
181180
.groupBy("k").count().collect()
182181

183-
benchmark.addCase(s"codegen = F") { _ =>
182+
benchmark.addCase("codegen = F") { _ =>
184183
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
185184
f()
186185
}
187186
}
188187

189-
benchmark.addCase(s"codegen = T hashmap = F") { _ =>
188+
benchmark.addCase("codegen = T hashmap = F") { _ =>
190189
withSQLConf(
191190
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
192191
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
@@ -195,7 +194,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
195194
}
196195
}
197196

198-
benchmark.addCase(s"codegen = T hashmap = T") { _ =>
197+
benchmark.addCase("codegen = T hashmap = T") { _ =>
199198
withSQLConf(
200199
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
201200
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
@@ -225,13 +224,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
225224
.sum()
226225
.collect()
227226

228-
benchmark.addCase(s"codegen = F") { _ =>
227+
benchmark.addCase("codegen = F") { _ =>
229228
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
230229
f()
231230
}
232231
}
233232

234-
benchmark.addCase(s"codegen = T hashmap = F") { _ =>
233+
benchmark.addCase("codegen = T hashmap = F") { _ =>
235234
withSQLConf(
236235
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
237236
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
@@ -240,7 +239,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
240239
}
241240
}
242241

243-
benchmark.addCase(s"codegen = T hashmap = T") { _ =>
242+
benchmark.addCase("codegen = T hashmap = T") { _ =>
244243
withSQLConf(
245244
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
246245
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",

0 commit comments

Comments
 (0)