liviazhu commented on code in PR #54277:
URL: https://github.com/apache/spark/pull/54277#discussion_r2829758964


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/OperatorStateMetadata.scala:
##########
@@ -352,7 +357,7 @@ class OperatorStateMetadataV2Reader(
 
   // List the available batches in the operator metadata directory
   private def listOperatorMetadataBatches(): Array[Long] = {
-    if (!fm.exists(metadataDirPath)) {
+    if (!fm.exists(metadataDirPath.getParent) || !fm.exists(metadataDirPath)) {

Review Comment:
   If we don't do this, if state directory doesn't exist, this will throw an 
error rather than return an empty list. To maintain the previous behavior, we 
add this check to return the empty list.



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