Interface SupportsSchemaEvolution
- All Superinterfaces:
Table
A mix-in interface for
Table schema evolution support. Data sources can implement this
interface to indicate the schema changes they support during write operations. Tables must
report capability TableCapability.AUTOMATIC_SCHEMA_EVOLUTION for schema evolution to
happen.
During automatic schema evolution, Spark computes the set of column changes (e.g. adding a new
column, widening a column type) needed to make the target table schema compatible with the
source data schema. Each candidate change is passed to supportsColumnChange(org.apache.spark.sql.connector.catalog.TableChange.ColumnChange) to
determine whether the data source can apply it. Changes that are not supported are skipped and
Spark will attempt to resolve such changes using casts. If casting is not supported, the query
will fail.
- Since:
- 4.2.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the given column change can be applied to the table during automatic schema evolution.Methods inherited from interface org.apache.spark.sql.connector.catalog.Table
capabilities, columns, constraints, id, name, partitioning, properties, schema, version
-
Method Details
-
supportsColumnChange
Returns whether the given column change can be applied to the table during automatic schema evolution. This should returntruewhen the data source can physically apply the change, for example adding a new column or performing a lossless type widening.
-