[ https://issues.apache.org/jira/browse/SPARK-37448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-37448: ----------------------------------- Labels: pull-request-available (was: ) > Multiple optimizations related to CurrentOrigin.withOrigin > ---------------------------------------------------------- > > Key: SPARK-37448 > URL: https://issues.apache.org/jira/browse/SPARK-37448 > Project: Spark > Issue Type: Improvement > Components: Optimizer > Affects Versions: 4.0.0 > Reporter: Josh Rosen > Assignee: Josh Rosen > Priority: Major > Labels: pull-request-available > > This PR / Jira proposes multiple optimizations related to > CurrentOrigin.withOrigin, including: > *Avoid CurrentOrigin.withOrigin calls in tree transformation methods when > partial function isn't defined* > `CurrentOrigin.withOrigin \{ block }` performs a ThreadLocal.get() call to > retrieve the current value of the `origin` thread local so it can be restored > after `block` exits. > TreeNode has transform methods which apply PartialFunctions to every node in > the tree. By checking `rule.isDefinedAt` before applying a rule we can skip > the `CurrentOrigin.withOrigin` call in cases where we know the partial > function isn't defined. This avoids the performance overhead associated with > thread-local reads and sets. > *Small optimizations to withOrigin itself to save a thread-local* write. > See PR for full details. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org