Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-36444][SQL] Remove OptimizeSubqueries from batch of PartitionPruning #33664

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class SparkOptimizer(
override def defaultBatches: Seq[Batch] = (preOptimizationBatches ++ super.defaultBatches :+
Batch("Optimize Metadata Only Query", Once, OptimizeMetadataOnlyQuery(catalog)) :+
Batch("PartitionPruning", Once,
PartitionPruning,
OptimizeSubqueries) :+
PartitionPruning) :+
Batch("Pushdown Filters from PartitionPruning", fixedPoint,
Comment on lines 44 to 46
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is:

  private val partitionPruningRules = Seq(PartitionPruning) ++
    (if (catalog.conf.dynamicPartitionPruningReuseBroadcastOnly) Nil else Seq(OptimizeSubqueries))

    Batch("PartitionPruning", Once,
      partitionPruningRules: _*) :+

PushDownPredicates) :+
Batch("Cleanup filters that cannot be pushed down", Once,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,32 @@ TakeOrderedAndProject [item_id,ss_item_rev,ss_dev,cs_item_rev,cs_dev,ws_item_rev
ColumnarToRow
InputAdapter
Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk]
InputAdapter
BroadcastExchange #2
WholeStageCodegen (2)
Project [d_date_sk]
BroadcastHashJoin [d_date,d_date]
Filter [d_date_sk]
ColumnarToRow
InputAdapter
Scan parquet default.date_dim [d_date_sk,d_date]
InputAdapter
BroadcastExchange #3
WholeStageCodegen (1)
Project [d_date]
Filter [d_week_seq]
Subquery #1
SubqueryBroadcast [d_date_sk] #1
BroadcastExchange #2
WholeStageCodegen (2)
Project [d_date_sk]
BroadcastHashJoin [d_date,d_date]
Filter [d_date_sk]
ColumnarToRow
InputAdapter
Scan parquet default.date_dim [d_date_sk,d_date]
InputAdapter
BroadcastExchange #3
WholeStageCodegen (1)
Project [d_week_seq]
Filter [d_date]
Project [d_date]
Filter [d_week_seq]
Subquery #2
WholeStageCodegen (1)
Project [d_week_seq]
Filter [d_date]
ColumnarToRow
InputAdapter
Scan parquet default.date_dim [d_date,d_week_seq]
ColumnarToRow
InputAdapter
Scan parquet default.date_dim [d_date,d_week_seq]
ColumnarToRow
InputAdapter
Scan parquet default.date_dim [d_date,d_week_seq]
InputAdapter
ReusedExchange [d_date_sk] #2
InputAdapter
BroadcastExchange #4
WholeStageCodegen (3)
Expand All @@ -66,6 +68,7 @@ TakeOrderedAndProject [item_id,ss_item_rev,ss_dev,cs_item_rev,cs_dev,ws_item_rev
ColumnarToRow
InputAdapter
Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk]
ReusedSubquery [d_date_sk] #1
InputAdapter
ReusedExchange [d_date_sk] #2
InputAdapter
Expand All @@ -87,6 +90,7 @@ TakeOrderedAndProject [item_id,ss_item_rev,ss_dev,cs_item_rev,cs_dev,ws_item_rev
ColumnarToRow
InputAdapter
Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk]
ReusedSubquery [d_date_sk] #1
InputAdapter
ReusedExchange [d_date_sk] #2
InputAdapter
Expand Down
Loading