You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "n-young-db (via GitHub)" <gi...@apache.org> on 2024/06/07 22:33:24 UTC
[PR] [SPARK-48544][SQL] Reduce memory pressure of empty TreeNode BitSets [spark]
n-young-db opened a new pull request, #46919:
URL: https://github.com/apache/spark/pull/46919
### What changes were proposed in this pull request?
- Changed the `tags` variable of the `TreeNode` class to initialize lazily. This will reduce unnecessary driver memory pressure.
### Why are the changes needed?
- Plans with large expression or operator trees are known to cause driver memory pressure; this is one step in alleviating that issue.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing UT covers behavior. Outwards facing behavior does not change.
### Was this patch authored or co-authored using generative AI tooling?
No
--
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-48544][SQL] Reduce memory pressure of empty TreeNode BitSets [spark]
Posted by "JoshRosen (via GitHub)" <gi...@apache.org>.
JoshRosen closed pull request #46919: [SPARK-48544][SQL] Reduce memory pressure of empty TreeNode BitSets
URL: https://github.com/apache/spark/pull/46919
--
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-48544][SQL] Reduce memory pressure of empty TreeNode BitSets [spark]
Posted by "JoshRosen (via GitHub)" <gi...@apache.org>.
JoshRosen commented on PR #46919:
URL: https://github.com/apache/spark/pull/46919#issuecomment-2159011976
Merged to master (4.0.0). Thanks @n-young-db!
--
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-48544][SQL] Reduce memory pressure of empty TreeNode BitSets [spark]
Posted by "JoshRosen (via GitHub)" <gi...@apache.org>.
JoshRosen commented on code in PR #46919:
URL: https://github.com/apache/spark/pull/46919#discussion_r1632089466
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala:
##########
@@ -120,7 +120,14 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]]
* ineffective for subsequent apply calls on this tree because query plan structures are
* immutable.
*/
- private val ineffectiveRules: BitSet = new BitSet(RuleIdCollection.NumRules)
+ private[this] var _ineffectiveRules: BitSet = null
+ private def ineffectiveRules: BitSet = {
+ if (_ineffectiveRules eq null) {
+ _ineffectiveRules = new BitSet(RuleIdCollection.NumRules)
+ }
+ _ineffectiveRules
+ }
+ private def isIneffectiveRulesEmpty = _ineffectiveRules == null
Review Comment:
On re-review, I think this should be
```suggestion
private def isIneffectiveRulesEmpty = _ineffectiveRules eq null
```
--
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