Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/18799#discussion_r132050517
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala
---
@@ -437,4 +441,48 @@ object HDFSMetadataLog {
}
}
}
+
+ /**
+ * Verify if batchIds are continuous and between `startId` and `endId`.
+ *
+ * @param batchIds the sorted ids to verify.
+ * @param startId the start id. If it's set, batchIds should start with
this id.
+ * @param endId the start id. If it's set, batchIds should end with this
id.
+ */
+ def verifyBatchIds(batchIds: Seq[Long], startId: Option[Long], endId:
Option[Long]): Unit = {
+ // Verify that we can get all batches between `startId` and `endId`.
+ if (startId.isDefined || endId.isDefined) {
+ if (batchIds.isEmpty) {
+ throw new IllegalStateException(s"batch
${startId.orElse(endId).get} doesn't exist")
--- End diff --
would be good to print the range that was asked for. otherwise its hard to
see what was expected while debugging.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]