You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/03 11:58:46 UTC

[GitHub] [spark] mgaido91 commented on issue #24223: [SPARK-27278][SQL] Optimize GetMapValue when the map is a foldable and the key is not

mgaido91 commented on issue #24223: [SPARK-27278][SQL] Optimize GetMapValue when the map is a foldable and the key is not
URL: https://github.com/apache/spark/pull/24223#issuecomment-479458601
 
 
   I have run:
   ```
   val dfPlan = spark.range(10).selectExpr(
        "map(1, 1, 2, id, 3, id * 2, 4, 1, 5, 2, 6, 3, 7, 4)[id] as x").queryExecution.executedPlan
   val times = (1 to 20).map(_ => time(dfPlan.executeCollect()))
   println("Avg time: " + (times.sum / times.size) / 1e6 + " ms")
   ```
   Before the change I got `Avg time: 20.001603 ms`, after I got `Avg time: 18.727406 ms`, hence roughly a 10% improvement from this test.
   
   Despite this, I quite agree with the concern related to the generated code size, which in general is not a big deal but it may cause regression if this makes WholeStageCodegen fallback to normal code generation. The other case is safer w.r.t this topic, as it removes the `CreateMap` which would be quite verbose as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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