Source:
<code>private Optional<InternalHiveSplit> createInternalHiveSplit( Path path, BlockLocation[] blockLocations, long start, long length, long fileSize, OptionalInt readBucketNumber, OptionalInt tableBucketNumber, boolean splittable, Optional<byte[]> extraFileInfo) { String pathString = path.toString(); if (!pathMatchesPredicate(pathDomain, pathString)) { return Optional.empty(); } boolean forceLocalScheduling = this.forceLocalScheduling; if (fileSize == 0 && blockLocations.length == 0) { blockLocations = new BlockLocation[] {new BlockLocation()}; forceLocalScheduling = false; } ImmutableList.Builder<InternalHiveBlock> blockBuilder = ImmutableList.builder(); for (BlockLocation blockLocation : blockLocations) { long blockStart = Math.max(start, blockLocation.getOffset()); long blockEnd = Math.min(start + length, blockLocation.getOffset() + blockLocation.getLength()); if (blockStart > blockEnd) { continue; } if (blockStart == blockEnd && !(blockStart == start && blockEnd == start + length)) { continue; } List<HostAddress> addresses = getHostAddresses(blockLocation); if (!needsHostAddresses(forceLocalScheduling, addresses)) { addresses = ImmutableList.of(); } blockBuilder.add(new InternalHiveBlock(blockEnd, addresses)); } List<InternalHiveBlock> blocks = blockBuilder.build(); checkBlocks(blocks, start, length); if (!splittable) { List<HostAddress> addresses = blocks.get(0).getAddresses(); if (!needsHostAddresses(forceLocalScheduling, addresses)) { addresses = ImmutableList.of(); } blocks = ImmutableList.of(new InternalHiveBlock(start + length, addresses)); } URI relativePath = partitionInfo.getPath().relativize(path.toUri()); return Optional.of(new InternalHiveSplit( relativePath.toString(), start, start + length, length, blocks, readBucketNumber, tableBucketNumber, splittable, forceLocalScheduling && allBlocksHaveRealAddress(blocks), <START> (nodeSelectionStrategy == NodeSelectionStrategy.HARD_AFFINITY && !allBlocksHaveRealAddress(blocks)) ? NodeSelectionStrategy.NO_PREFERENCE : nodeSelectionStrategy, <END> s3SelectPushdownEnabled && S3SelectPushdown.isCompressionCodecSupported(inputFormat, path), partitionInfo, extraFileInfo)); }</code><technical_language>nit: static import enums in NodeSelectionStrategy</technical_language>

Target:
private Optional<InternalHiveSplit> createInternalHiveSplit( Path path, BlockLocation[] blockLocations, long start, long length, long fileSize, OptionalInt readBucketNumber, OptionalInt tableBucketNumber, boolean splittable, Optional<byte[]> extraFileInfo) { String pathString = path.toString(); if (!pathMatchesPredicate(pathDomain, pathString)) { return Optional.empty(); } boolean forceLocalScheduling = this.forceLocalScheduling; if (fileSize == 0 && blockLocations.length == 0) { blockLocations = new BlockLocation[] {new BlockLocation()}; forceLocalScheduling = false; } ImmutableList.Builder<InternalHiveBlock> blockBuilder = ImmutableList.builder(); for (BlockLocation blockLocation : blockLocations) { long blockStart = Math.max(start, blockLocation.getOffset()); long blockEnd = Math.min(start + length, blockLocation.getOffset() + blockLocation.getLength()); if (blockStart > blockEnd) { continue; } if (blockStart == blockEnd && !(blockStart == start && blockEnd == start + length)) { continue; } List<HostAddress> addresses = getHostAddresses(blockLocation); if (!needsHostAddresses(forceLocalScheduling, addresses)) { addresses = ImmutableList.of(); } blockBuilder.add(new InternalHiveBlock(blockEnd, addresses)); } List<InternalHiveBlock> blocks = blockBuilder.build(); checkBlocks(blocks, start, length); if (!splittable) { List<HostAddress> addresses = blocks.get(0).getAddresses(); if (!needsHostAddresses(forceLocalScheduling, addresses)) { addresses = ImmutableList.of(); } blocks = ImmutableList.of(new InternalHiveBlock(start + length, addresses)); } URI relativePath = partitionInfo.getPath().relativize(path.toUri()); return Optional.of(new InternalHiveSplit( relativePath.toString(), start, start + length, length, blocks, readBucketNumber, tableBucketNumber, splittable, forceLocalScheduling && allBlocksHaveRealAddress(blocks), (nodeSelectionStrategy == HARD_AFFINITY && !allBlocksHaveRealAddress(blocks)) ? NO_PREFERENCE : nodeSelectionStrategy, s3SelectPushdownEnabled && S3SelectPushdown.isCompressionCodecSupported(inputFormat, path), partitionInfo, extraFileInfo)); }