public class ProjectedRowData extends Object implements org.apache.flink.table.data.RowData
RowData
which provides a projected view of the underlying RowData
.
Projection includes both reducing the accessible fields and reordering them.
Note: This class supports only top-level projections, not nested projections.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static ProjectedRowData |
from(int[] projection)
Create an empty
ProjectedRowData starting from a projection array. |
static ProjectedRowData |
from(int[][] projection)
Like
from(int[]) , but throws IllegalArgumentException if the provided projection array contains nested projections, which are not supported by ProjectedRowData . |
static ProjectedRowData |
from(Projection projection)
Create an empty
ProjectedRowData starting from a Projection . |
int |
getArity() |
org.apache.flink.table.data.ArrayData |
getArray(int pos) |
byte[] |
getBinary(int pos) |
boolean |
getBoolean(int pos) |
byte |
getByte(int pos) |
org.apache.flink.table.data.DecimalData |
getDecimal(int pos,
int precision,
int scale) |
double |
getDouble(int pos) |
float |
getFloat(int pos) |
int |
getInt(int pos) |
long |
getLong(int pos) |
org.apache.flink.table.data.MapData |
getMap(int pos) |
<T> org.apache.flink.table.data.RawValueData<T> |
getRawValue(int pos) |
org.apache.flink.table.data.RowData |
getRow(int pos,
int numFields) |
org.apache.flink.types.RowKind |
getRowKind() |
short |
getShort(int pos) |
org.apache.flink.table.data.StringData |
getString(int pos) |
org.apache.flink.table.data.TimestampData |
getTimestamp(int pos,
int precision) |
int |
hashCode() |
boolean |
isNullAt(int pos) |
ProjectedRowData |
replaceRow(org.apache.flink.table.data.RowData row)
Replaces the underlying
RowData backing this ProjectedRowData . |
void |
setRowKind(org.apache.flink.types.RowKind kind) |
String |
toString() |
public ProjectedRowData replaceRow(org.apache.flink.table.data.RowData row)
RowData
backing this ProjectedRowData
.
This method replaces the row data in place and does not return a new object. This is done for performance reasons.
public int getArity()
getArity
in interface org.apache.flink.table.data.RowData
public org.apache.flink.types.RowKind getRowKind()
getRowKind
in interface org.apache.flink.table.data.RowData
public void setRowKind(org.apache.flink.types.RowKind kind)
setRowKind
in interface org.apache.flink.table.data.RowData
public boolean isNullAt(int pos)
isNullAt
in interface org.apache.flink.table.data.RowData
public boolean getBoolean(int pos)
getBoolean
in interface org.apache.flink.table.data.RowData
public byte getByte(int pos)
getByte
in interface org.apache.flink.table.data.RowData
public short getShort(int pos)
getShort
in interface org.apache.flink.table.data.RowData
public int getInt(int pos)
getInt
in interface org.apache.flink.table.data.RowData
public long getLong(int pos)
getLong
in interface org.apache.flink.table.data.RowData
public float getFloat(int pos)
getFloat
in interface org.apache.flink.table.data.RowData
public double getDouble(int pos)
getDouble
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.StringData getString(int pos)
getString
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.DecimalData getDecimal(int pos, int precision, int scale)
getDecimal
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.TimestampData getTimestamp(int pos, int precision)
getTimestamp
in interface org.apache.flink.table.data.RowData
public <T> org.apache.flink.table.data.RawValueData<T> getRawValue(int pos)
getRawValue
in interface org.apache.flink.table.data.RowData
public byte[] getBinary(int pos)
getBinary
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.ArrayData getArray(int pos)
getArray
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.MapData getMap(int pos)
getMap
in interface org.apache.flink.table.data.RowData
public org.apache.flink.table.data.RowData getRow(int pos, int numFields)
getRow
in interface org.apache.flink.table.data.RowData
public static ProjectedRowData from(int[][] projection) throws IllegalArgumentException
from(int[])
, but throws IllegalArgumentException
if the provided projection
array contains nested projections, which are not supported by ProjectedRowData
.
The array represents the mapping of the fields of the original 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.
IllegalArgumentException
Projection
,
ProjectedRowData
public static ProjectedRowData from(int[] projection)
ProjectedRowData
starting from a projection
array.
The array represents the mapping of the fields of the original 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.
Projection
,
ProjectedRowData
public static ProjectedRowData from(Projection projection)
ProjectedRowData
starting from a Projection
.
Throws IllegalStateException
if the provided projection
array contains
nested projections, which are not supported by ProjectedRowData
.
Projection
,
ProjectedRowData
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.