Skip to content

Commit

Permalink
Fix string variable
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyum committed Sep 27, 2018
1 parent 45add92 commit 3439992
Showing 1 changed file with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
spark.range(N).selectExpr("(id & 65535) as k").groupBy("k").sum().collect()
}

benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
benchmark.addCase("codegen = F", numIters = 2) { _ =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
f()
}
}

benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
Expand All @@ -88,7 +88,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
}
}

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

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

benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
benchmark.addCase("codegen = F", numIters = 2) { _ =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
f()
}
}

benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
Expand All @@ -124,7 +124,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
}
}

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

benchmark.addCase(s"codegen = F", numIters = 2) { _ =>
spark.conf.set("spark.sql.codegen.wholeStage", "false")
benchmark.addCase("codegen = F", numIters = 2) { _ =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
f()
}
}

benchmark.addCase(s"codegen = T hashmap = F", numIters = 3) { _ =>
benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
Expand All @@ -160,7 +159,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
}
}

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

benchmark.addCase(s"codegen = F") { _ =>
benchmark.addCase("codegen = F") { _ =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
f()
}
}

benchmark.addCase(s"codegen = T hashmap = F") { _ =>
benchmark.addCase("codegen = T hashmap = F") { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
Expand All @@ -195,7 +194,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
}
}

benchmark.addCase(s"codegen = T hashmap = T") { _ =>
benchmark.addCase("codegen = T hashmap = T") { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
Expand Down Expand Up @@ -225,13 +224,13 @@ object AggregateBenchmark extends SqlBasedBenchmark {
.sum()
.collect()

benchmark.addCase(s"codegen = F") { _ =>
benchmark.addCase("codegen = F") { _ =>
withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") {
f()
}
}

benchmark.addCase(s"codegen = T hashmap = F") { _ =>
benchmark.addCase("codegen = T hashmap = F") { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false",
Expand All @@ -240,7 +239,7 @@ object AggregateBenchmark extends SqlBasedBenchmark {
}
}

benchmark.addCase(s"codegen = T hashmap = T") { _ =>
benchmark.addCase("codegen = T hashmap = T") { _ =>
withSQLConf(
SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true",
SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true",
Expand Down

0 comments on commit 3439992

Please sign in to comment.