Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/12153#discussion_r59595284 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala --- @@ -197,4 +204,26 @@ private[sql] object FileSourceStrategy extends Strategy with Logging { case _ => Nil } + + private def getBlockLocations(file: FileStatus): Array[BlockLocation] = file match { + case f: LocatedFileStatus => f.getBlockLocations + case f => Array.empty[BlockLocation] + } + + // Given locations of all blocks of a single file, `blockLocations`, and an `offset` position of + // the same file, find out the index of the block that contains this `offset`. If no such block + // can be found, returns -1. + private def getBlockIndex(blockLocations: Array[BlockLocation], offset: Long): Int = { --- End diff -- This one is a little bit tricky, would like to keep it here for readability.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org