danny0405 commented on code in PR #13411:
URL: https://github.com/apache/hudi/pull/13411#discussion_r2155748129
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/FileGroupReaderBasedMergeHandle.java:
##########
@@ -139,23 +137,65 @@ private void init(CompactionOperation operation, String
partitionPath, Option<Ho
// Create the writer for writing the new version file
fileWriter = HoodieFileWriterFactory.getFileWriter(instantTime,
newFilePath, hoodieTable.getStorage(),
- config, writeSchemaWithMetaFields, taskContextSupplier,
getRecordType());
+ config, writeSchemaWithMetaFields, taskContextSupplier, recordType);
} catch (IOException io) {
- LOG.error("Error in update task at commit " + instantTime, io);
+ LOG.error("Error in update task at commit {}", instantTime, io);
writeStatus.setGlobalError(io);
throw new HoodieUpsertException("Failed to initialize HoodieUpdateHandle
for FileId: " + fileId + " on commit "
+ instantTime + " on path " +
hoodieTable.getMetaClient().getBasePath(), io);
}
}
- protected abstract HoodieRecord.HoodieRecordType getRecordType();
-
/**
* Reads the file slice of a compaction operation using a file group reader,
- * by getting an iterator of the records; then writes the records to a new
base file
- * using parquet writer.
+ * by getting an iterator of the records; then writes the records to a new
base file.
*/
- protected abstract void write();
+ public void write() {
+ boolean usePosition =
config.getBooleanOrDefault(MERGE_USE_RECORD_POSITIONS);
+ Option<InternalSchema> internalSchemaOption =
SerDeHelper.fromJson(config.getInternalSchema());
+ TypedProperties props = TypedProperties.copy(config.getProps());
Review Comment:
Is the orderingValue set up correctly for merger based merging?
Please check it:
```java
public static String getOrderingField(Properties properties) {
String orderField = null;
if
(properties.containsKey(HoodiePayloadProps.PAYLOAD_ORDERING_FIELD_PROP_KEY)) {
orderField =
properties.getProperty(HoodiePayloadProps.PAYLOAD_ORDERING_FIELD_PROP_KEY);
} else if
(properties.containsKey("hoodie.datasource.write.precombine.field")) {
orderField =
properties.getProperty("hoodie.datasource.write.precombine.field");
} else if
(properties.containsKey(HoodieTableConfig.PRECOMBINE_FIELD.key())) {
orderField =
properties.getProperty(HoodieTableConfig.PRECOMBINE_FIELD.key());
}
return orderField;
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]