Github user tdas commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1471,16 +1494,15 @@ private[spark] object Utils extends Logging {
        * and `endIndex` is based on the cumulative size of all the files take 
        * the given order. See figure below for more details.
    -  def offsetBytes(files: Seq[File], start: Long, end: Long): String = {
    -    val fileLengths = { _.length }
    +  def offsetBytes(files: Seq[File], fileLengths: Seq[Long], start: Long, 
end: Long): String = {
         val startIndex = math.max(start, 0)
         val endIndex = math.min(end, fileLengths.sum)
         val fileToLength =
         logDebug("Log files: \n" + fileToLength.mkString("\n"))
         val stringBuffer = new StringBuffer((endIndex - startIndex).toInt)
         var sum = 0L
    -    for (file <- files) {
    + { case (file, fileLength) =>
    --- End diff --
    Missed this. We should assert that the number of files and lengths are 
same. Zip can silently drop stuff if they dont match

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to