Package io.delta.kernel.internal.util
Class ColumnMapping
Object
io.delta.kernel.internal.util.ColumnMapping
Utilities related to the column mapping feature.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StructTypeconvertToPhysicalSchema(StructType logicalSchema, StructType physicalSchema, String columnMappingMode) Helper method that converts the logical schema (requested by the connector) to physical schema of the data stored in data files based on the table's column mapping mode.static StringgetColumnMappingMode(Map<String, String> configuration) Returns the column mapping mode from the given configuration.static StringgetPhysicalName(StructField field) Returns the physical name for a givenStructFieldstatic voidthrowOnUnsupportedColumnMappingMode(Metadata metadata) Checks if the given column mapping mode in the given table metadata is supported.
-
Field Details
-
COLUMN_MAPPING_MODE_KEY
- See Also:
-
COLUMN_MAPPING_MODE_NONE
- See Also:
-
COLUMN_MAPPING_MODE_NAME
- See Also:
-
COLUMN_MAPPING_MODE_ID
- See Also:
-
COLUMN_MAPPING_PHYSICAL_NAME_KEY
- See Also:
-
COLUMN_MAPPING_ID_KEY
- See Also:
-
PARQUET_FIELD_ID_KEY
- See Also:
-
-
Method Details
-
getColumnMappingMode
Returns the column mapping mode from the given configuration.- Parameters:
configuration- Configuration- Returns:
- Column mapping mode. One of ("none", "name", "id")
-
throwOnUnsupportedColumnMappingMode
Checks if the given column mapping mode in the given table metadata is supported. Throws on unsupported modes.- Parameters:
metadata- Metadata of the table
-
convertToPhysicalSchema
public static StructType convertToPhysicalSchema(StructType logicalSchema, StructType physicalSchema, String columnMappingMode) Helper method that converts the logical schema (requested by the connector) to physical schema of the data stored in data files based on the table's column mapping mode.- Parameters:
logicalSchema- Logical schema of the scanphysicalSchema- Physical schema of the scancolumnMappingMode- Column mapping mode
-
getPhysicalName
Returns the physical name for a givenStructField
-