Package org.apache.flink.cdc.common.sink
Interface ExistingTableSchemaExpansionSupport
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FlussMetaDataApplier,PaimonMetadataApplier
@Experimental public interface ExistingTableSchemaExpansionSupport extends Serializable
Connector-specific capabilities required to safely expand an existing target table schema.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Schema>getExistingTableSchema(TableId tableId)Returns the current schema of the target table, orOptional.empty()if the table does not exist.booleanisColumnNameCaseSensitive()Returns whether target column names are matched case-sensitively.DataTypenormalizeToTargetDataType(TableId tableId, String columnName, DataType pipelineDataType, Schema existingTargetSchema)Converts a pipeline type to the canonical CDC representation of the physical type that this applier will create in the existing target table.
-
-
-
Method Detail
-
getExistingTableSchema
Optional<Schema> getExistingTableSchema(TableId tableId) throws SchemaEvolveException
Returns the current schema of the target table, orOptional.empty()if the table does not exist. Target physical types must be converted to the same canonical CDC representation produced bynormalizeToTargetDataType(TableId, String, DataType, Schema). The returned schema should include any table options that affect physical type mapping.- Throws:
SchemaEvolveException
-
normalizeToTargetDataType
DataType normalizeToTargetDataType(TableId tableId, String columnName, DataType pipelineDataType, Schema existingTargetSchema)
Converts a pipeline type to the canonical CDC representation of the physical type that this applier will create in the existing target table. For example, if bothCHAR(n)andVARCHAR(n)map to targetVARCHAR(n), this method should return the sameVARCHAR(n)representation for both input types. The existing target schema provides table options needed by sinks whose type mapping depends on table properties.This method must not query or modify the target table.
-
isColumnNameCaseSensitive
boolean isColumnNameCaseSensitive()
Returns whether target column names are matched case-sensitively.
-
-