praneetsharma commented on a change in pull request #26123: [SPARK-27259][CORE]
Allow setting -1 as split size for InputFileBlock
URL: https://github.com/apache/spark/pull/26123#discussion_r335247770
##########
File path: core/src/main/scala/org/apache/spark/rdd/InputFileBlockHolder.scala
##########
@@ -76,7 +76,6 @@ private[spark] object InputFileBlockHolder {
def set(filePath: String, startOffset: Long, length: Long): Unit = {
require(filePath != null, "filePath cannot be null")
require(startOffset >= 0, s"startOffset ($startOffset) cannot be negative")
- require(length >= 0, s"length ($length) cannot be negative")
Review comment:
Hi @dongjoon-hyun
The file InputFileBlockHolder contains the following statement stating that
-1 can be returned as length if the length is unknown:
```
/**
* Returns the length of the block being read, or -1 if it is unknown.
*/
def getLength: Long = inputBlock.get().get().length
```
Yes, I can modify the validation statement to be `length >= -1`. In that
case, what can be a good message? Maybe - "length ($length) cannot be smaller
than -1"?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]