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(InternalRowSerializer keySerializer,
InternalRowSerializer 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.
|
boolean |
isAdd() |
InternalRow |
key() |
int |
level() |
static int[][] |
project(int[][] keyProjection,
int[][] valueProjection,
int numKeyFields) |
KeyValue |
replace(InternalRow key,
long sequenceNumber,
RowKind valueKind,
InternalRow value) |
KeyValue |
replace(InternalRow key,
RowKind valueKind,
InternalRow value) |
KeyValue |
replaceKey(InternalRow key) |
KeyValue |
replaceValue(InternalRow value) |
KeyValue |
replaceValueKind(RowKind valueKind) |
static String |
rowDataToString(InternalRow row,
RowType type) |
static RowType |
schema(RowType keyType,
RowType valueType) |
static RowType |
schemaWithLevel(RowType keyType,
RowType valueType) |
long |
sequenceNumber() |
KeyValue |
setLevel(int level) |
String |
toString(RowType keyType,
RowType valueType) |
InternalRow |
value() |
RowKind |
valueKind() |
public static final long UNKNOWN_SEQUENCE
public static final int UNKNOWN_LEVEL
public KeyValue replace(InternalRow key, RowKind valueKind, InternalRow value)
public KeyValue replace(InternalRow key, long sequenceNumber, RowKind valueKind, InternalRow value)
public KeyValue replaceKey(InternalRow key)
public KeyValue replaceValue(InternalRow value)
public InternalRow key()
public long sequenceNumber()
public RowKind valueKind()
public boolean isAdd()
public InternalRow value()
public int level()
public KeyValue setLevel(int level)
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(InternalRowSerializer keySerializer, InternalRowSerializer valueSerializer)
@VisibleForTesting public String toString(RowType keyType, RowType valueType)
public static String rowDataToString(InternalRow row, RowType type)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.