sigmod commented on a change in pull request #32060:
URL: https://github.com/apache/spark/pull/32060#discussion_r608418836



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
##########
@@ -48,6 +52,27 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]]
   @transient
   lazy val outputSet: AttributeSet = AttributeSet(output)
 
+  // Override `treePatternBits` to propagate bits for its expressions.
+  override lazy val treePatternBits: BitSet = {
+    val bits: BitSet = new BitSet(TreePattern.maxId)
+    // Propagate node pattern bits
+    val nodeTypeIterator = nodePatterns.iterator

Review comment:
       Lazily constructing `treePatternBits` is a frequent operation and thus I 
avoided for-loops as the style guide suggests:
   https://github.com/databricks/scala-style-guide#traversal-and-zipwithindex




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

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