Class StructProjection

java.lang.Object
org.apache.iceberg.util.StructProjection
All Implemented Interfaces:
StructLike

public class StructProjection extends Object implements StructLike
  • Method Details

    • create

      public static StructProjection create(Schema schema, Set<Integer> ids)
      Creates a projecting wrapper for StructLike rows.

      This projection does not work with repeated types like lists and maps.

      Parameters:
      schema - schema of rows wrapped by this projection
      ids - field ids from the row schema to project
      Returns:
      a wrapper to project rows
    • create

      public static StructProjection create(Schema dataSchema, Schema projectedSchema)
      Creates a projecting wrapper for StructLike rows.

      This projection does not work with repeated types like lists and maps.

      Parameters:
      dataSchema - schema of rows wrapped by this projection
      projectedSchema - result schema of the projected rows
      Returns:
      a wrapper to project rows
    • create

      public static StructProjection create(Types.StructType structType, Types.StructType projectedStructType)
      Creates a projecting wrapper for StructLike rows.

      This projection does not work with repeated types like lists and maps.

      Parameters:
      structType - type of rows wrapped by this projection
      projectedStructType - result type of the projected rows
      Returns:
      a wrapper to project rows
    • createAllowMissing

      public static StructProjection createAllowMissing(Types.StructType structType, Types.StructType projectedStructType)
      Creates a projecting wrapper for StructLike rows.

      This projection allows missing fields and does not work with repeated types like lists and maps.

      Parameters:
      structType - type of rows wrapped by this projection
      projectedStructType - result type of the projected rows
      Returns:
      a wrapper to project rows
    • wrap

      public StructProjection wrap(StructLike newStruct)
    • copyFor

      public StructProjection copyFor(StructLike newStruct)
    • size

      public int size()
      Specified by:
      size in interface StructLike
    • get

      public <T> T get(int pos, Class<T> javaClass)
      Specified by:
      get in interface StructLike
    • set

      public <T> void set(int pos, T value)
      Specified by:
      set in interface StructLike