Github user yhuai commented on a diff in the pull request: https://github.com/apache/spark/pull/12153#discussion_r58613895 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala --- @@ -137,10 +140,12 @@ private[sql] object FileSourceStrategy extends Strategy with Logging { val splitFiles = selectedPartitions.flatMap { partition => partition.files.flatMap { file => + val blockLocations = getBlockLocations(file) (0L to file.getLen by maxSplitBytes).map { offset => val remaining = file.getLen - offset val size = if (remaining > maxSplitBytes) maxSplitBytes else remaining - PartitionedFile(partition.values, file.getPath.toUri.toString, offset, size) + val hosts = getBlockHosts(blockLocations, offset) + PartitionedFile(partition.values, file.getPath.toUri.toString, offset, size, hosts) --- End diff -- How about we add document to this FileSourceStrategy to explain our strategy? So, readers can quickly understand what we are doing at here.
--- 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