public abstract class Projection extends Object
Projection represents a list of (possibly nested) indexes that can be used to project
data types. A row projection includes both reducing the accessible fields and reordering them.| Modifier and Type | Method and Description |
|---|---|
static Projection |
empty()
Create an empty
Projection, that is a projection that projects no fields, returning
an empty DataType. |
boolean |
equals(Object o) |
int |
hashCode() |
abstract boolean |
isNested() |
static Projection |
of(int[] indexes)
Create a
Projection of the provided indexes. |
static Projection |
of(int[][] indexes)
Create a
Projection of the provided indexes. |
abstract org.apache.flink.table.types.logical.RowType |
project(org.apache.flink.table.types.logical.RowType logicalType) |
abstract int[][] |
toNestedIndexes()
Convert this instance to a nested projection index paths.
|
String |
toString() |
abstract int[] |
toTopLevelIndexes()
Convert this instance to a projection of top level indexes.
|
public abstract org.apache.flink.table.types.logical.RowType project(org.apache.flink.table.types.logical.RowType logicalType)
public abstract boolean isNested()
true whether this projection is nested or not.public abstract int[] toTopLevelIndexes()
DataType. For example, [0, 2, 1] specifies to
include in the following order the 1st field, the 3rd field and the 2nd field of the row.IllegalStateException - if this projection is nested.public abstract int[][] toNestedIndexes()
DataType, including nested rows. For example, [[0,
2, 1], ...] specifies to include the 2nd field of the 3rd field of the 1st field in the
top-level row.public static Projection empty()
Projection, that is a projection that projects no fields, returning
an empty DataType.public static Projection of(int[] indexes)
Projection of the provided indexes.toTopLevelIndexes()public static Projection of(int[][] indexes)
Projection of the provided indexes.toNestedIndexes()Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.