Skip to content

Commit

Permalink
[HUDI-7436] Fix the conditions for determining whether the records ne…
Browse files Browse the repository at this point in the history
…ed to be rewritten
  • Loading branch information
coder_wang committed Feb 27, 2024
1 parent cba65e3 commit 285ed82
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ private Option<Function<HoodieRecord, HoodieRecord>> composeSchemaEvolutionTrans
Schema newWriterSchema = AvroInternalSchemaConverter.convert(mergedSchema, writerSchema.getFullName());
Schema writeSchemaFromFile = AvroInternalSchemaConverter.convert(writeInternalSchema, newWriterSchema.getFullName());
boolean needToReWriteRecord = sameCols.size() != colNamesFromWriteSchema.size()
|| SchemaCompatibility.checkReaderWriterCompatibility(newWriterSchema, writeSchemaFromFile).getType() == org.apache.avro.SchemaCompatibility.SchemaCompatibilityType.COMPATIBLE;
&& SchemaCompatibility.checkReaderWriterCompatibility(newWriterSchema, writeSchemaFromFile).getType()
== org.apache.avro.SchemaCompatibility.SchemaCompatibilityType.COMPATIBLE;

if (needToReWriteRecord) {
Map<String, String> renameCols = InternalSchemaUtils.collectRenameCols(writeInternalSchema, querySchema);
return Option.of(record -> {
Expand Down

0 comments on commit 285ed82

Please sign in to comment.