[HUDI-727]: Copy default values of fields if not present when rewriting incoming record with new schema (#1427)
This commit is contained in:
@@ -212,7 +212,7 @@ public abstract class AbstractRealtimeRecordReader {
|
||||
throw new HoodieException("Field " + fn + " not found in log schema. Query cannot proceed! "
|
||||
+ "Derived Schema Fields: " + new ArrayList<>(schemaFieldsMap.keySet()));
|
||||
} else {
|
||||
projectedFields.add(new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultValue()));
|
||||
projectedFields.add(new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultVal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ public abstract class AbstractRealtimeRecordReader {
|
||||
Field field = schemaFieldsMap.get(columnName.toLowerCase());
|
||||
|
||||
if (field != null) {
|
||||
hiveSchemaFields.add(new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultValue()));
|
||||
hiveSchemaFields.add(new Schema.Field(field.name(), field.schema(), field.doc(), field.defaultVal()));
|
||||
} else {
|
||||
// Hive has some extra virtual columns like BLOCK__OFFSET__INSIDE__FILE which do not exist in table schema.
|
||||
// They will get skipped as they won't be found in the original schema.
|
||||
|
||||
Reference in New Issue
Block a user