public class SchemaMergingUtils extends Object
Constructor and Description |
---|
SchemaMergingUtils() |
Modifier and Type | Method and Description |
---|---|
static DataType |
merge(DataType base0,
DataType update0,
AtomicInteger highestFieldId,
boolean allowExplicitCast)
Merge the base data type and the update data type if possible.
|
static RowType |
mergeSchemas(RowType tableSchema,
RowType dataSchema,
AtomicInteger highestFieldId,
boolean allowExplicitCast) |
static TableSchema |
mergeSchemas(TableSchema currentTableSchema,
RowType targetType,
boolean allowExplicitCast) |
public static TableSchema mergeSchemas(TableSchema currentTableSchema, RowType targetType, boolean allowExplicitCast)
public static RowType mergeSchemas(RowType tableSchema, RowType dataSchema, AtomicInteger highestFieldId, boolean allowExplicitCast)
public static DataType merge(DataType base0, DataType update0, AtomicInteger highestFieldId, boolean allowExplicitCast)
For RowType, find the fields which exists in both the base schema and the update schema, and try to merge them by calling the method iteratively; remain those fields that are only in the base schema and append those fields that are only in the update schema.
For other complex type, try to merge the element types.
For primitive data type, we treat that's compatible if the original type can be safely cast to the new type.
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.