You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "liuzqt (via GitHub)" <gi...@apache.org> on 2026/03/25 19:52:04 UTC

[PR] [SPARK-56121][SQL] Use dedicated EmptyRelation node for static PropagateEmptyRelation [spark]

liuzqt opened a new pull request, #55014:
URL: https://github.com/apache/spark/pull/55014

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'common/utils/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   
   In previous PR https://github.com/apache/spark/pull/46830, I introduce dedicated node for empty relation
   - `EmptyRelation` logical node
   - `EmptyRelationExec` physical node
   and wrap the eliminated plan segment in `AQEPropagateEmptyRelation`
   
   In this PR, I extend this change to static `PropagateEmptyRelation` rule.
   
   Note: this doesn't 100% remove the usage of empty `LocalRelation` for empty, there're still some other rules which can produce empty `LocalRelation`, and we still recognize the empty `LocalRelation` as an empty relation.
   
   
   ### Why are the changes needed?
   Better observability, in both spark UI, and explain plan string, we're able to see the eliminated plan segment.
   
   **Plan string**
   - before
   ```
   == Physical Plan ==
   LocalTableScan (1)
   
   
   (1) LocalTableScan
   Output [2]: [k#1L, v#7]
   Arguments: <empty>, [k#1L, v#7]
   
   ```
   - after
   
   ```
   == Physical Plan ==
   EmptyRelation (1)
   +- Project [k#1L, 1 AS v#7]
      +- EmptyRelation
         +- Join Inner, (k#1L = k#6L)
            :- RepartitionByExpression [k#1L], 8
            :  +- Project [id#0L AS k#1L]
            :     +- Range (0, 50000, step=1, splits=Some(32))
            +- LocalRelation <empty>, [k#6L]
   
   
   (1) EmptyRelation
   Output [2]: [k#1L, v#7]
   Arguments: [plan_id=2]
   ```
   
   **Spark UI**
   - before
   <img width="327" height="241" alt="Screenshot 2026-03-23 at 7 45 26 PM" src="https://github.com/user-attachments/assets/af9167d3-10f5-4258-b1c8-f79690c41def" />
   
   - after
   
   <img width="525" height="674" alt="Screenshot 2026-03-23 at 8 21 05 PM" src="https://github.com/user-attachments/assets/5156f6f0-efbf-47e7-a060-905ce3091a6d" />
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   - spark ui change
   - explain string change
   
   ### How was this patch tested?
   
   - updated exising UTs
   - verified Spark UI change
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56121][SQL] Use dedicated EmptyRelation node for static PropagateEmptyRelation [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #55014: [SPARK-56121][SQL] Use dedicated EmptyRelation node for static PropagateEmptyRelation
URL: https://github.com/apache/spark/pull/55014


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-56121][SQL] Use dedicated EmptyRelation node for static PropagateEmptyRelation [spark]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #55014:
URL: https://github.com/apache/spark/pull/55014#issuecomment-4884323567

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org