Skip to content

Commit

Permalink
[SPARK-20283][SQL] Add preOptimizationBatches
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Apr 10, 2017
1 parent fd711ea commit 263dc68
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ class SparkOptimizer(
experimentalMethods: ExperimentalMethods)
extends Optimizer(catalog, conf) {

override def batches: Seq[Batch] = (super.batches :+
override def batches: Seq[Batch] = (preOptimizationBatches ++ super.batches :+
Batch("Optimize Metadata Only Query", Once, OptimizeMetadataOnlyQuery(catalog, conf)) :+
Batch("Extract Python UDF from Aggregate", Once, ExtractPythonUDFFromAggregate) :+
Batch("Prune File Source Table Partitions", Once, PruneFileSourcePartitions)) ++
postHocOptimizationBatches :+
Batch("User Provided Optimizers", fixedPoint, experimentalMethods.extraOptimizations: _*)

/**
* Optimization batches that are executed before the regular optimization batches (also before
* the finish analysis batch).
*/
def preOptimizationBatches: Seq[Batch] = Nil

/**
* Optimization batches that are executed after the regular optimization batches, but before the
* batch executing the [[ExperimentalMethods]] optimizer rules. This hook can be used to add
Expand Down

0 comments on commit 263dc68

Please sign in to comment.