Skip to content

Commit c67bcf3

Browse files
committed
Incorporating comment of modifying the validation to be `length >= -1`
1 parent 53ae391 commit c67bcf3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/main/scala/org/apache/spark/rdd/InputFileBlockHolder.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ private[spark] object InputFileBlockHolder {
7676
def set(filePath: String, startOffset: Long, length: Long): Unit = {
7777
require(filePath != null, "filePath cannot be null")
7878
require(startOffset >= 0, s"startOffset ($startOffset) cannot be negative")
79+
require(length >= -1, s"length ($length) cannot be smaller than -1")
7980
inputBlock.get().set(new FileBlock(UTF8String.fromString(filePath), startOffset, length))
8081
}
8182

0 commit comments

Comments
 (0)