anishshri-db commented on code in PR #47528: URL: https://github.com/apache/spark/pull/47528#discussion_r1704572305
########## sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/OperatorStateMetadataSuite.scala: ########## @@ -133,6 +154,21 @@ class OperatorStateMetadataSuite extends StreamTest with SharedSparkSession { Array(StateStoreMetadataV2("default", 0, numShufflePartitions, checkpointDir.toString)), "") checkOperatorStateMetadata(checkpointDir.toString, 0, expectedMetadata, 2) + + // Verify that the state store metadata is not available for invalid batches. + val ex = intercept[Exception] { + val invalidBatchId = OperatorStateMetadataUtils.getLastOffsetBatch(spark, + checkpointDir.toString) + 1 + checkOperatorStateMetadata(checkpointDir.toString, 0, expectedMetadata, 2, + Some(invalidBatchId)) + } + assert(ex.getMessage.contains("Failed to read the operator metadata")) Review Comment: Done -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org