Skip to content

Commit 68aa403

Browse files
committed
add loggings and allow 0 as range start
1 parent 36bdcb6 commit 68aa403

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client-s3/src/main/kotlin/app/cash/backfila/client/s3/internal/S3DatasourceBackfillOperator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class S3DatasourceBackfillOperator<R : Any, P : Any>(
2727
override fun prepareBackfill(request: PrepareBackfillRequest): PrepareBackfillResponse {
2828
val config = parametersOperator.constructBackfillConfig(request)
2929
backfill.validate(config)
30-
31-
require(request.range?.start == null && request.range?.end == null) {
30+
val isRangeValid = (request.range?.start?.utf8() == "0" || request.range?.start == null) && request.range?.end == null
31+
require(isRangeValid) {
3232
// We could think about supporting this later by making the range mean a byte seek into all S3 files.
3333
// This would mean we would need to support some kind of seek forward or seek back for record start.
3434
// That or perhaps we only support it for single file?
3535
// In any case, we are not implementing this now.
36-
"Range is currently unsupported for S3 Backfils"
36+
"Ranges are not currently supported for S3 Backfills. Additionally, cloning an S3 backfill requires using a new empty range."
3737
}
3838

3939
val pathPrefix = backfill.getPrefix(config)

0 commit comments

Comments
 (0)