Package org.apache.iceberg.util
Class StructProjection
- java.lang.Object
-
- org.apache.iceberg.util.StructProjection
-
- All Implemented Interfaces:
StructLike
public class StructProjection extends java.lang.Object implements StructLike
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StructProjection
copyFor(StructLike newStruct)
static StructProjection
create(Schema schema, java.util.Set<java.lang.Integer> ids)
Creates a projecting wrapper forStructLike
rows.static StructProjection
create(Schema dataSchema, Schema projectedSchema)
Creates a projecting wrapper forStructLike
rows.static StructProjection
create(Types.StructType structType, Types.StructType projectedStructType)
Creates a projecting wrapper forStructLike
rows.static StructProjection
createAllowMissing(Types.StructType structType, Types.StructType projectedStructType)
Creates a projecting wrapper forStructLike
rows.<T> T
get(int pos, java.lang.Class<T> javaClass)
<T> void
set(int pos, T value)
int
size()
StructProjection
wrap(StructLike newStruct)
-
-
-
Method Detail
-
create
public static StructProjection create(Schema schema, java.util.Set<java.lang.Integer> ids)
Creates a projecting wrapper forStructLike
rows.This projection does not work with repeated types like lists and maps.
- Parameters:
schema
- schema of rows wrapped by this projectionids
- 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 forStructLike
rows.This projection does not work with repeated types like lists and maps.
- Parameters:
dataSchema
- schema of rows wrapped by this projectionprojectedSchema
- 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 forStructLike
rows.This projection does not work with repeated types like lists and maps.
- Parameters:
structType
- type of rows wrapped by this projectionprojectedStructType
- 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 forStructLike
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 projectionprojectedStructType
- 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 interfaceStructLike
-
get
public <T> T get(int pos, java.lang.Class<T> javaClass)
- Specified by:
get
in interfaceStructLike
-
set
public <T> void set(int pos, T value)
- Specified by:
set
in interfaceStructLike
-
-