public class KeyValue extends Object
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOWN_LEVEL |
static long |
UNKNOWN_SEQUENCE |
Constructor and Description |
---|
KeyValue() |
Modifier and Type | Method and Description |
---|---|
KeyValue |
copy(org.apache.flink.table.runtime.typeutils.RowDataSerializer keySerializer,
org.apache.flink.table.runtime.typeutils.RowDataSerializer valueSerializer) |
static List<DataField> |
createKeyValueFields(List<DataField> keyFields,
List<DataField> valueFields,
int maxKeyId)
Create key-value fields, we need to add a const value to the id of value field to ensure that
they are consistent when compared by field id.
|
org.apache.flink.table.data.RowData |
key() |
int |
level() |
static int[][] |
project(int[][] keyProjection,
int[][] valueProjection,
int numKeyFields) |
KeyValue |
replace(org.apache.flink.table.data.RowData key,
long sequenceNumber,
org.apache.flink.types.RowKind valueKind,
org.apache.flink.table.data.RowData value) |
KeyValue |
replace(org.apache.flink.table.data.RowData key,
org.apache.flink.types.RowKind valueKind,
org.apache.flink.table.data.RowData value) |
KeyValue |
replaceKey(org.apache.flink.table.data.RowData key) |
static String |
rowDataToString(org.apache.flink.table.data.RowData row,
org.apache.flink.table.types.logical.RowType type) |
static org.apache.flink.table.types.logical.RowType |
schema(org.apache.flink.table.types.logical.RowType keyType,
org.apache.flink.table.types.logical.RowType valueType) |
long |
sequenceNumber() |
KeyValue |
setLevel(int level) |
String |
toString(org.apache.flink.table.types.logical.RowType keyType,
org.apache.flink.table.types.logical.RowType valueType) |
org.apache.flink.table.data.RowData |
value() |
org.apache.flink.types.RowKind |
valueKind() |
public static final long UNKNOWN_SEQUENCE
public static final int UNKNOWN_LEVEL
public KeyValue replace(org.apache.flink.table.data.RowData key, org.apache.flink.types.RowKind valueKind, org.apache.flink.table.data.RowData value)
public KeyValue replace(org.apache.flink.table.data.RowData key, long sequenceNumber, org.apache.flink.types.RowKind valueKind, org.apache.flink.table.data.RowData value)
public KeyValue replaceKey(org.apache.flink.table.data.RowData key)
public org.apache.flink.table.data.RowData key()
public long sequenceNumber()
public org.apache.flink.types.RowKind valueKind()
public org.apache.flink.table.data.RowData value()
public int level()
public KeyValue setLevel(int level)
public static org.apache.flink.table.types.logical.RowType schema(org.apache.flink.table.types.logical.RowType keyType, org.apache.flink.table.types.logical.RowType valueType)
public static List<DataField> createKeyValueFields(List<DataField> keyFields, List<DataField> valueFields, int maxKeyId)
We will use 5 as maxKeyId, and create fields for Table1/Table2 as follows
Then we can compare these two table fields with the field id.
keyFields
- the key fieldsvalueFields
- the value fieldsmaxKeyId
- the max key idpublic static int[][] project(int[][] keyProjection, int[][] valueProjection, int numKeyFields)
@VisibleForTesting public KeyValue copy(org.apache.flink.table.runtime.typeutils.RowDataSerializer keySerializer, org.apache.flink.table.runtime.typeutils.RowDataSerializer valueSerializer)
@VisibleForTesting public String toString(org.apache.flink.table.types.logical.RowType keyType, org.apache.flink.table.types.logical.RowType valueType)
public static String rowDataToString(org.apache.flink.table.data.RowData row, org.apache.flink.table.types.logical.RowType type)
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.