From 1970d911d91d7b53389629169e45bf33127ed2e8 Mon Sep 17 00:00:00 2001 From: Reynold Xin Date: Sat, 19 Mar 2016 00:27:23 -0700 Subject: [SPARK-14018][SQL] Use 64-bit num records in BenchmarkWholeStageCodegen ## What changes were proposed in this pull request? 500L << 20 is actually pretty close to 32-bit int limit. I was trying to increase this to 500L << 23 and got negative numbers instead. ## How was this patch tested? I'm only modifying test code. Author: Reynold Xin Closes #11839 from rxin/SPARK-14018. --- .../apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala index a16bd77bfe..0b1cb90186 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala @@ -42,7 +42,7 @@ class BenchmarkWholeStageCodegen extends SparkFunSuite { lazy val sc = SparkContext.getOrCreate(conf) lazy val sqlContext = SQLContext.getOrCreate(sc) - def runBenchmark(name: String, values: Int)(f: => Unit): Unit = { + def runBenchmark(name: String, values: Long)(f: => Unit): Unit = { val benchmark = new Benchmark(name, values) Seq(false, true).foreach { enabled => @@ -57,7 +57,7 @@ class BenchmarkWholeStageCodegen extends SparkFunSuite { // These benchmark are skipped in normal build ignore("range/filter/sum") { - val N = 500 << 20 + val N = 500L << 20 runBenchmark("rang/filter/sum", N) { sqlContext.range(N).filter("(id & 1) = 1").groupBy().sum().collect() } @@ -71,7 +71,7 @@ class BenchmarkWholeStageCodegen extends SparkFunSuite { } ignore("range/limit/sum") { - val N = 500 << 20 + val N = 500L << 20 runBenchmark("range/limit/sum", N) { sqlContext.range(N).limit(1000000).groupBy().sum().collect() } @@ -85,7 +85,7 @@ class BenchmarkWholeStageCodegen extends SparkFunSuite { } ignore("stat functions") { - val N = 100 << 20 + val N = 100L << 20 runBenchmark("stddev", N) { sqlContext.range(N).groupBy().agg("id" -> "stddev").collect() -- cgit v1.2.3