Class MappingUtil


  • public class MappingUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static NameMapping create​(Schema schema)
      Create a name-based mapping for a schema.
      static NameMapping update​(NameMapping mapping, java.util.Map<java.lang.Integer,​Types.NestedField> updates, org.apache.iceberg.relocated.com.google.common.collect.Multimap<java.lang.Integer,​Types.NestedField> adds)
      Update a name-based mapping using changes to a schema.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static NameMapping create​(Schema schema)
        Create a name-based mapping for a schema.

        The mapping returned by this method will use the schema's name for each field.

        Parameters:
        schema - a Schema
        Returns:
        a NameMapping initialized with the schema's fields and names
      • update

        public static NameMapping update​(NameMapping mapping,
                                         java.util.Map<java.lang.Integer,​Types.NestedField> updates,
                                         org.apache.iceberg.relocated.com.google.common.collect.Multimap<java.lang.Integer,​Types.NestedField> adds)
        Update a name-based mapping using changes to a schema.
        Parameters:
        mapping - a name-based mapping
        updates - a map from field ID to updated field definitions
        adds - a map from parent field ID to nested fields to be added
        Returns:
        an updated mapping with names added to renamed fields and the mapping extended for new fields