XiDuo You created SPARK-62401:
---------------------------------

             Summary: Allow shuffle push-down through a union in queries with 
subqueries that hold no movable shuffle
                 Key: SPARK-62401
                 URL: https://issues.apache.org/jira/browse/SPARK-62401
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: XiDuo You


Shuffle push-down through a union (SPARK-60379) is disabled for the whole query 
whenever the query contains a subquery. This narrows that gate.

A subquery plan is never rewritten, and a plan embedding a subquery is left 
unrewritten only while that subquery holds an ENSURE_REQUIREMENTS hash or keyed 
shuffle below which the rule can reach a union. Queries whose subqueries hold 
no such shuffle - plain scalar and IN subqueries, runtime Bloom filter builds - 
now get the push-down, in the main plan.

The freeze protects exchange/stage reuse, which is keyed on the exchange's 
canonical form: rewriting a subquery's plan, or rewriting the enclosing plan's 
copy of an exchange the subquery still matches, breaks the shared stage cache 
and broadcast-only dynamic partition pruning reuse. The gate therefore reads 
the exchange alone, not the operator above it (a subquery copy below a join 
input that allowJoinInputs=false never moves still matches the enclosing copy 
below a window the rewrite would remove), and it does not read the reuse 
configs; with reuse off the freeze only forgoes the rewrite. The internal 
spark.sql.adaptive.pushDownShuffleThroughUnion.allowWithSubqueries.enabled 
override still lifts both.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to