-
- Downloads
[SPARK-16596] [SQL] Refactor DataSourceScanExec to do partition discovery at...
[SPARK-16596] [SQL] Refactor DataSourceScanExec to do partition discovery at execution instead of planning time ## What changes were proposed in this pull request? Partition discovery is rather expensive, so we should do it at execution time instead of during physical planning. Right now there is not much benefit since ListingFileCatalog will read scan for all partitions at planning time anyways, but this can be optimized in the future. Also, there might be more information for partition pruning not available at planning time. This PR moves a lot of the file scan logic from planning to execution time. All file scan operations are handled by `FileSourceScanExec`, which handles both batched and non-batched file scans. This requires some duplication with `RowDataSourceScanExec`, but is probably worth it so that `FileSourceScanExec` does not need to depend on an input RDD. TODO: In another pr, move DataSourceScanExec to it's own file. ## How was this patch tested? Existing tests (it might be worth adding a test that catalog.listFiles() is delayed until execution, but this can be delayed until there is an actual benefit to doing so). Author: Eric Liang <ekl@databricks.com> Closes #14241 from ericl/refactor.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala 1 addition, 1 deletion...scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/ExistingRDD.scala 318 additions, 77 deletions...in/scala/org/apache/spark/sql/execution/ExistingRDD.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala 13 additions, 8 deletions.../spark/sql/execution/datasources/DataSourceStrategy.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala 10 additions, 190 deletions.../spark/sql/execution/datasources/FileSourceStrategy.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala 3 additions, 3 deletions...k/sql/execution/datasources/FileSourceStrategySuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala 5 additions, 6 deletions...sql/execution/datasources/parquet/ParquetQuerySuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala 2 additions, 2 deletions.../org/apache/spark/sql/streaming/FileStreamSinkSuite.scala
- sql/hive/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala 2 additions, 2 deletions...cala/org/apache/spark/sql/sources/BucketedReadSuite.scala
- sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala 2 additions, 2 deletions...a/org/apache/spark/sql/sources/HadoopFsRelationTest.scala
Loading
Please register or sign in to comment