Package org.apache.iceberg.util
Class StructProjection
java.lang.Object
org.apache.iceberg.util.StructProjection
- All Implemented Interfaces:
StructLike
-
Method Summary
Modifier and TypeMethodDescriptioncopyFor
(StructLike newStruct) static StructProjection
Creates a projecting wrapper forStructLike
rows.static StructProjection
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
<T> void
set
(int pos, T value) int
size()
wrap
(StructLike newStruct)
-
Method Details
-
create
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
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
-
copyFor
-
size
public int size()- Specified by:
size
in interfaceStructLike
-
get
- Specified by:
get
in interfaceStructLike
-
set
public <T> void set(int pos, T value) - Specified by:
set
in interfaceStructLike
-