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

    https://github.com/apache/spark/pull/14266#discussion_r73040155
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala
 ---
    @@ -576,4 +576,605 @@ class AggregateBenchmark extends BenchmarkBase {
         benchmark.run()
       }
     
    -}
    +  // This test does not do any benchmark, instead it produces generated 
code for vectorized
    +  // and row-based hashmaps.
    +  ignore("generated code comparison for vectorized vs. rowbased") {
    +    val N = 20 << 23
    +
    +    sparkSession.conf.set("spark.sql.codegen.wholeStage", "true")
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.columns.max", 
"30")
    +
    +    sparkSession.range(N)
    +      .selectExpr(
    +        "id & 1023 as k1",
    +        "cast (id & 1023 as string) as k2")
    +      .createOrReplaceTempView("test")
    +
    +    // dataframe/query
    +    val query = sparkSession.sql("select count(k1), sum(k1) from test 
group by k1, k2")
    +
    +    // vectorized
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl", 
"vectorized")
    +    query.queryExecution.debug.codegen()
    +
    +    // row based
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.enforce.impl", 
"rowbased")
    +    query.queryExecution.debug.codegen()
    +  }
    +
    +  ignore("1 key field, 1 value field, distinct linear keys") {
    +    val N = 20 << 22;
    +
    +    var timeStart: Long = 0L
    +    var timeEnd: Long = 0L
    +    var nsPerRow: Long = 0L
    +    var i = 0
    +    sparkSession.conf.set("spark.sql.codegen.wholeStage", "true")
    +    sparkSession.conf.set("spark.sql.codegen.aggregate.map.columns.max", 
"30")
    +
    +    // scalastyle:off
    +    println(Benchmark.getJVMOSInfo())
    --- End diff --
    
    nit: to minimize duplication, maybe create a small utility function that 
can then be reused in all test cases.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to