Source:
private Optional<InternalHiveSplit> createInternalHiveSplit( Path path, BlockLocation[] blockLocations, long start, long length, long fileSize, OptionalInt readBucketNumber, OptionalInt tableBucketNumber, boolean splittable) { 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 (!schedulerUsesAddresses && !(forceLocalScheduling && hasRealAddress(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 (!schedulerUsesAddresses && !(forceLocalScheduling && hasRealAddress(addresses))) { addresses = ImmutableList.of(); } blocks = ImmutableList.of(new InternalHiveBlock(start + length, addresses)); } return Optional.of(new InternalHiveSplit( pathString, start, start + length, length, blocks, readBucketNumber, tableBucketNumber, splittable, forceLocalScheduling && allBlocksHaveRealAddress(blocks), s3SelectPushdownenabled && S3SelectPushdown.isCompressionCodecSupported(inputFormat, path), partitionInfo)); }

Target:
private Optional<InternalHiveSplit> createInternalHiveSplit( Path path, BlockLocation[] blockLocations, long start, long length, long fileSize, OptionalInt readBucketNumber, OptionalInt tableBucketNumber, boolean splittable) { 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), s3SelectPushdownEnabled && S3SelectPushdown.isCompressionCodecSupported(inputFormat, path), partitionInfo)); }