Class ColumnMapping

Object
io.delta.kernel.internal.util.ColumnMapping

public class ColumnMapping extends Object
Utilities related to the column mapping feature.
  • Field Details

  • Method Details

    • getColumnMappingMode

      public static String getColumnMappingMode(Map<String,String> configuration)
      Returns the column mapping mode from the given configuration.
      Parameters:
      configuration - Configuration
      Returns:
      Column mapping mode. One of ("none", "name", "id")
    • throwOnUnsupportedColumnMappingMode

      public static void throwOnUnsupportedColumnMappingMode(Metadata metadata)
      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 scan
      physicalSchema - Physical schema of the scan
      columnMappingMode - Column mapping mode
    • getPhysicalName

      public static String getPhysicalName(StructField field)
      Returns the physical name for a given StructField