Preparation for Avro update (#2650)
This commit is contained in:
committed by
GitHub
parent
8bc65b9318
commit
aa0da72c59
@@ -30,7 +30,7 @@
|
||||
},
|
||||
{
|
||||
"name":"strategy",
|
||||
"type":["HoodieClusteringStrategy", "null"],
|
||||
"type":["null", "HoodieClusteringStrategy"],
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
|
||||
@@ -28,22 +28,22 @@
|
||||
{
|
||||
"name":"userAction",
|
||||
"type":[ "null", "string" ],
|
||||
"default": "null"
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
"name":"groupAction",
|
||||
"type":[ "null", "string" ],
|
||||
"default": "null"
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
"name":"otherAction",
|
||||
"type":[ "null", "string" ],
|
||||
"default": "null"
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
"name":"stickyBit",
|
||||
"type":[ "null", "boolean" ],
|
||||
"default": "null"
|
||||
"default": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
{
|
||||
"name":"operationType",
|
||||
"type":["null", "string"],
|
||||
"default": ""
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
"name":"clusteringPlan", /* only set if operationType == clustering" */
|
||||
"type":["HoodieClusteringPlan", "null"],
|
||||
"type":["null", "HoodieClusteringPlan"],
|
||||
"default": null
|
||||
},
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/* overlaps with 'instantsToRollback' field. Adding this to track action type for all the instants being rolled back. */
|
||||
{
|
||||
"name": "restoreInstantInfo",
|
||||
"default": null,
|
||||
"default": [],
|
||||
"type": {
|
||||
"type": "array",
|
||||
"default": null,
|
||||
|
||||
@@ -330,7 +330,7 @@ public class TableSchemaResolver {
|
||||
for (final Field newSchemaField : newSchema.getFields()) {
|
||||
final Field oldSchemaField = SchemaCompatibility.lookupWriterField(oldSchema, newSchemaField);
|
||||
if (oldSchemaField == null) {
|
||||
if (newSchemaField.defaultValue() == null) {
|
||||
if (newSchemaField.defaultVal() == null) {
|
||||
// C3: newly added field in newSchema does not have a default value
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.apache.hudi.exception.SchemaCompatibilityException;
|
||||
import org.apache.avro.Schema;
|
||||
import org.apache.avro.generic.GenericData;
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.codehaus.jackson.node.NullNode;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -184,7 +183,7 @@ public class TestHoodieAvroUtils {
|
||||
Schema.Field evolvedField1 = new Schema.Field("key", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", JsonProperties.NULL_VALUE);
|
||||
Schema.Field evolvedField2 = new Schema.Field("key1", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", JsonProperties.NULL_VALUE);
|
||||
Schema.Field evolvedField3 = new Schema.Field("key2", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", JsonProperties.NULL_VALUE);
|
||||
Schema.Field evolvedField4 = new Schema.Field("evolved_field", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", NullNode.getInstance());
|
||||
Schema.Field evolvedField4 = new Schema.Field("evolved_field", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", JsonProperties.NULL_VALUE);
|
||||
Schema.Field evolvedField5 = new Schema.Field("evolved_field1", HoodieAvroUtils.METADATA_FIELD_SCHEMA, "", JsonProperties.NULL_VALUE);
|
||||
evolvedFields.add(evolvedField1);
|
||||
evolvedFields.add(evolvedField2);
|
||||
|
||||
Reference in New Issue
Block a user