srowen commented on a change in pull request #26650: [CORE] Fix a bug in
getBlockHosts
URL: https://github.com/apache/spark/pull/26650#discussion_r350806411
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/PartitionedFileUtil.scala
##########
@@ -69,8 +69,10 @@ object PartitionedFileUtil {
b.getHosts -> (b.getOffset + b.getLength - offset).min(length)
// The fragment ends at a position within this block
- case b if offset <= b.getOffset && offset + length < b.getLength =>
- b.getHosts -> (offset + length - b.getOffset).min(length)
+ case b if offset <= b.getOffset &&
Review comment:
I think this might properly be `<` instead, but, I also think it's not
needed. The `offset >= b.getOffset` case is already handled above if the
fragment starts within the block. And if it starts after the block, then it
won't end in the block, and that is checked below. So this should already only
handle cases where it starts before the block.
----------------------------------------------------------------
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]