Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16391#discussion_r93955613
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/DatasetBenchmark.scala ---
    @@ -133,24 +134,29 @@ object DatasetBenchmark {
       def aggregate(spark: SparkSession, numRows: Long): Benchmark = {
         import spark.implicits._
     
    -    val df = spark.range(1, numRows).select($"id".as("l"), 
$"id".cast(StringType).as("s"))
    +    val rdd = spark.sparkContext.range(0, numRows)
    +    val ds = spark.range(0, numRows)
    +    val df = ds.toDF("l")
    +
         val benchmark = new Benchmark("aggregate", numRows)
     
    -    val rdd = spark.sparkContext.range(1, numRows).map(l => Data(l, 
l.toString))
         benchmark.addCase("RDD sum") { iter =>
    -      rdd.aggregate(0L)(_ + _.l, _ + _)
    +      rdd.map(l => (l % 10, l)).reduceByKey(_ + _).foreach(_ => Unit)
    --- End diff --
    
    Actually, I think we should also have a test case for aggregation without 
group by.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to