dtarima commented on code in PR #45181:
URL: https://github.com/apache/spark/pull/45181#discussion_r1528497911


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala:
##########
@@ -369,6 +375,20 @@ class QueryExecution(
     Utils.redact(sparkSession.sessionState.conf.stringRedactionPattern, 
message)
   }
 
+  /**
+   * This method performs a pre-order traversal and return a boolean Array
+   * representing whether some nodes of the logical tree are persisted.
+   */
+  def computeCacheStateSignature(): Array[Boolean] = {

Review Comment:
   It's not necessary to know the number of bits during construction.
   It's up to you, but just FYI, here is how it'd look like:
   ```scala
       val builder = BitSet.newBuilder
       var index = 0
       normalized.foreach { fragment =>
         val cached = fragment match {
           case _: IgnoreCachedData => false
           case _ => cacheManager.lookupCachedData(fragment).isDefined
         }
         if (cached) builder += index
         index += 1
       }
       builder.result()
   ```



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