Skip to content

Commit 16b02da

Browse files
committed
Address more
1 parent 7f85b63 commit 16b02da

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ object HDFSMetadataLog {
461461
if (minBatchId != startId.get) {
462462
val missingBatchIds = startId.get to minBatchId
463463
throw new IllegalStateException(
464-
s"batches (${missingBatchIds.mkString(", ")}) don't exist")
464+
s"batches (${missingBatchIds.mkString(", ")}) don't exist " +
465+
s"(startId: $startId, endId: $endId)")
465466
}
466467
}
467468

@@ -471,7 +472,8 @@ object HDFSMetadataLog {
471472
if (maxBatchId != endId.get) {
472473
val missingBatchIds = maxBatchId to endId.get
473474
throw new IllegalStateException(
474-
s"batches (${missingBatchIds.mkString(", ")}) don't exist")
475+
s"batches (${missingBatchIds.mkString(", ")}) don't exist " +
476+
s"(startId: $startId, endId: $endId)")
475477
}
476478
}
477479
}
@@ -481,7 +483,8 @@ object HDFSMetadataLog {
481483
val maxBatchId = batchIds.last
482484
val missingBatchIds = (minBatchId to maxBatchId).toSet -- batchIds
483485
if (missingBatchIds.nonEmpty) {
484-
throw new IllegalStateException(s"batches (${missingBatchIds.mkString(", ")}) don't exist")
486+
throw new IllegalStateException(s"batches (${missingBatchIds.mkString(", ")}) " +
487+
s"don't exist (startId: $startId, endId: $endId)")
485488
}
486489
}
487490
}

sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ class HDFSMetadataLogSuite extends SparkFunSuite with SharedSQLContext {
264264
import HDFSMetadataLog.verifyBatchIds
265265
verifyBatchIds(Seq(1L, 2L, 3L), Some(1L), Some(3L))
266266
verifyBatchIds(Seq(1L), Some(1L), Some(1L))
267+
verifyBatchIds(Seq(1L, 2L, 3L), None, Some(3L))
268+
verifyBatchIds(Seq(1L, 2L, 3L), Some(1L), None)
269+
verifyBatchIds(Seq(1L, 2L, 3L), None, None)
270+
267271
intercept[IllegalStateException](verifyBatchIds(Seq(), Some(1L), None))
268272
intercept[IllegalStateException](verifyBatchIds(Seq(), None, Some(1L)))
269273
intercept[IllegalStateException](verifyBatchIds(Seq(), Some(1L), Some(1L)))

0 commit comments

Comments
 (0)