Skip to content

Commit

Permalink
fix: fix missing key-partition pair when wrap HoodieRecord
Browse files Browse the repository at this point in the history
1. fix missing key-partition pair when wrap HoodieRecord

Signed-off-by: TheR1sing3un <[email protected]>
  • Loading branch information
TheR1sing3un committed Sep 20, 2024
1 parent cd39d04 commit 6c12925
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hudi.common.table.TableSchemaResolver;
import org.apache.hudi.common.table.compaction.SortMergeCompactionHelper;
import org.apache.hudi.common.util.SampleEstimator;
import org.apache.hudi.common.util.collection.Pair;
import org.apache.hudi.common.util.sorter.ExternalSorter;
import org.apache.hudi.common.util.sorter.ExternalSorterFactory;
import org.apache.hudi.common.util.sorter.ExternalSorterType;
Expand Down Expand Up @@ -98,8 +99,10 @@ private ClosableIterator<HoodieRecord> getBaseFileRecordIteratorInSortMergeCompa
ClosableIterator<HoodieRecord> wrapRecordItr = new CloseableMappingIterator<HoodieRecord, HoodieRecord>(rawRecordIter, record -> {
HoodieTableConfig tableConfig = mergeHandle.getHoodieTableMetaClient().getTableConfig();
try {
Option<Pair<String, String>> simpleKeyGenFieldsOpt =
tableConfig.populateMetaFields() ? Option.empty() : Option.of(Pair.of(tableConfig.getRecordKeyFieldProp(), tableConfig.getPartitionFieldProp()));
return record.copy()
.wrapIntoHoodieRecordPayloadWithParams(readSchema, tableConfig.getProps(), Option.empty(), writeConfig.allowOperationMetadataField(), Option.of(mergeHandle.getPartitionPath()),
.wrapIntoHoodieRecordPayloadWithParams(readSchema, tableConfig.getProps(), simpleKeyGenFieldsOpt, writeConfig.allowOperationMetadataField(), Option.of(mergeHandle.getPartitionPath()),
tableConfig.populateMetaFields(), Option.empty());
} catch (IOException e) {
throw new HoodieIOException("Failed to wrap record into HoodieRecordPayload", e);
Expand Down

0 comments on commit 6c12925

Please sign in to comment.