-
- Downloads
[SPARK-13873] [SQL] Avoid copy of UnsafeRow when there is no join in whole stage codegen
## What changes were proposed in this pull request? We need to copy the UnsafeRow since a Join could produce multiple rows from single input rows. We could avoid that if there is no join (or the join will not produce multiple rows) inside WholeStageCodegen. Updated the benchmark for `collect`, we could see 20-30% speedup. ## How was this patch tested? existing unit tests. Author: Davies Liu <davies@databricks.com> Closes #11740 from davies/avoid_copy2.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala 10 additions, 0 deletions...park/sql/catalyst/expressions/codegen/CodeGenerator.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/Expand.scala 1 addition, 0 deletions...rc/main/scala/org/apache/spark/sql/execution/Expand.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/GroupedIterator.scala 2 additions, 1 deletion...cala/org/apache/spark/sql/execution/GroupedIterator.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/Sort.scala 4 additions, 1 deletion.../src/main/scala/org/apache/spark/sql/execution/Sort.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegen.scala 7 additions, 2 deletions...la/org/apache/spark/sql/execution/WholeStageCodegen.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/TungstenAggregate.scala 4 additions, 0 deletions...che/spark/sql/execution/aggregate/TungstenAggregate.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashJoin.scala 2 additions, 0 deletions.../apache/spark/sql/execution/joins/BroadcastHashJoin.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoin.scala 1 addition, 0 deletions.../org/apache/spark/sql/execution/joins/SortMergeJoin.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/BenchmarkWholeStageCodegen.scala 4 additions, 4 deletions...ache/spark/sql/execution/BenchmarkWholeStageCodegen.scala
Please register or sign in to comment