rdblue commented on a change in pull request #2608:
URL: https://github.com/apache/iceberg/pull/2608#discussion_r635652898
##########
File path:
spark/src/main/java/org/apache/iceberg/spark/actions/BaseRewriteManifestsSparkAction.java
##########
@@ -310,37 +341,54 @@ private void deleteFiles(Iterable<String> locations) {
.run(fileIO::deleteFile);
}
- private static ManifestFile writeManifest(
+ private static RepairManifestHelper.RepairedManifestFile writeManifest(
List<Row> rows, int startIndex, int endIndex, Broadcast<FileIO> io,
- String location, int format, PartitionSpec spec, StructType sparkType)
throws IOException {
+ String location, int format, PartitionSpec spec, StructType sparkType,
+ RepairMode mode, Broadcast<Table> broadcastTable,
Broadcast<SerializableConfiguration> conf) throws IOException {
String manifestName = "optimized-m-" + UUID.randomUUID();
Path manifestPath = new Path(location, manifestName);
OutputFile outputFile =
io.value().newOutputFile(FileFormat.AVRO.addExtension(manifestPath.toString()));
Types.StructType dataFileType = DataFile.getType(spec.partitionType());
- SparkDataFile wrapper = new SparkDataFile(dataFileType, sparkType);
+ SparkDataFile wrapper = new SparkDataFile(dataFileType,
sparkType).withSpecId(spec.specId());
ManifestWriter<DataFile> writer = ManifestFiles.write(format, spec,
outputFile, null);
+ Set<String> repairedColumns = new HashSet<String>();
try {
for (int index = startIndex; index < endIndex; index++) {
Row row = rows.get(index);
long snapshotId = row.getLong(0);
long sequenceNumber = row.getLong(1);
Row file = row.getStruct(2);
- writer.existing(wrapper.wrap(file), snapshotId, sequenceNumber);
+ SparkDataFile dataFile = wrapper.wrap(file);
+ if (mode == RepairMode.REPAIR_ENTRIES) {
+ Optional<RepairManifestHelper.RepairedDataFile> repaired =
+ RepairManifestHelper.repairDataFile(dataFile,
broadcastTable.value(), spec, conf.value().value());
Review comment:
Nit: indentation is off.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]