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

   ### What changes were proposed in this pull request?
   
   `CallerInfo.inBloomFilterStatFunctionCall` used a nested `stack.exists` 
inside the outer predicate:
   
   ```scala
   stack.exists(
     _.getClassName.equals("org.apache.spark.sql.DataFrameStatFunctions")
       && stack.exists(_.getMethodName.equals("bloomFilter")))
   ```
   
   The inner `stack.exists` does not depend on the outer element and re-walks 
the whole stack for every candidate frame, making the check O(n^2) in stack 
depth. Split it into two independent single-pass checks that combine with `&&`; 
the resulting predicate is "the stack contains both a `DataFrameStatFunctions` 
frame and a `bloomFilter` frame," identical to the original.
   
   ### Why are the changes needed?
   
   `CallerInfo.create()` is invoked once per columnar rule application, so this 
predicate runs on every planned query. The change is a straight refactor with 
no behavior difference; the value is that the stack scan drops from quadratic 
to linear.
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   `mvn -pl gluten-core -Pspark-3.5 spotless:check` and `compile` pass. No 
behavior change, no new test.


-- 
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