liujiayi771 opened a new pull request, #12028:
URL: https://github.com/apache/gluten/pull/12028

   ## Summary
   
   For `SparkPlan` nodes that lack a `logicalLink` (e.g., `SortExec` generated 
by `EnsureRequirements`), `RemoveFallbackTagRule` previously removed their 
`FallbackTag` without persisting it anywhere. This caused the fallback reason 
to be lost when `GlutenQueryExecutionListener` later processes the finalized 
plan, resulting in a generic *"Gluten does not touch it or does not support 
it"* reason instead of the actual fallback reason.
   
   In https://github.com/apache/gluten/pull/12027, the test assertion for "get 
correct fallback reason on nodes without logicalLink" was changed from `forall` 
to `exists`, which hid this issue — among the `fallbackReasons`, one event's 
reason had degraded to the generic message because the physical plan tag was 
removed by `RemoveFallbackTagRule`, but `exists` only required *some* reasons 
to be correct, masking the fact that others were wrong.
   
   **Fix:** When a node has a `FallbackTag` but no `logicalLink`, create a 
`FallbackLogicalPlan` (a lightweight dummy `LeafNode`) to hold the tag, and 
attach it as the node's logical link via `setTagValue(LOGICAL_PLAN_TAG)`. This 
ensures `handleVanillaSparkPlan` can retrieve the correct fallback reason via 
`p.logicalLink.flatMap(FallbackTags.getOption)` even after the physical plan 
tags have been cleaned up.
   
   With this fix, the test assertion is changed back to `forall`, verifying 
that **all** fallback nodes now report the correct reason.
   
   ## Test plan
   
   - [x] Existing test "get correct fallback reason on nodes without 
logicalLink" now uses `forall` and verifies all fallback reasons are correct


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to