public enum HoodieCDCInferenceCase extends Enum<HoodieCDCInferenceCase>
HoodieCDCSupplementalLoggingMode.DATA_BEFORE_AFTER, it keeps all the fields about the
change data, including `op`, `ts_ms`, `before` and `after`. So read it and return directly,
no more other files need to be loaded.
when `hoodie.table.cdc.supplemental.logging.mode` is HoodieCDCSupplementalLoggingMode.DATA_BEFORE, it keeps the `op`, the key and the
`before` of the changing record. When `op` is equal to 'i' or 'u', need to get the current record from the
current base/log file as `after`.
when `hoodie.table.cdc.supplemental.logging.mode` is 'op_key', it just keeps the `op` and the key of
the changing record. When `op` is equal to 'i', `before` is null and get the current record
from the current base/log file as `after`. When `op` is equal to 'u', get the previous
record from the previous file slice as `before`, and get the current record from the
current base/log file as `after`. When `op` is equal to 'd', get the previous record from
the previous file slice as `before`, and `after` is null.
BASE_FILE_INSERT:
For this type, there must be a base file at the current instant. All the records from this
file is new-coming, so we can load this, mark all the records with `i`, and treat them as
the value of `after`. The value of `before` for each record is null.
BASE_FILE_DELETE:
For this type, there must be an empty file at the current instant, but a non-empty base file
at the previous instant. First we find this base file that has the same file group and belongs
to the previous instant. Then load this, mark all the records with `d`, and treat them as
the value of `before`. The value of `after` for each record is null.
LOG_FILE:
For this type, a normal log file of mor table will be used. First we need to load the previous
file slice(including the base file and other log files in the same file group). Then for each
record from the log file, get the key of this, and execute the following steps:
1) if the record is deleted,
a) if there is a record with the same key in the data loaded, `op` is 'd', 'before' is the
record from the data loaded, `after` is null;
b) if there is not a record with the same key in the data loaded, just skip.
2) the record is not deleted,
a) if there is a record with the same key in the data loaded, `op` is 'u', 'before' is the
record from the data loaded, `after` is the current record;
b) if there is not a record with the same key in the data loaded, `op` is 'i', 'before' is
null, `after` is the current record;
REPLACE_COMMIT:
For this type, it must be a replacecommit, like INSERT_OVERWRITE and DROP_PARTITION. It drops
a whole file group. First we find this file group. Then load this, mark all the records with
`d`, and treat them as the value of `before`. The value of `after` for each record is null.| Enum Constant and Description |
|---|
AS_IS |
BASE_FILE_DELETE |
BASE_FILE_INSERT |
LOG_FILE |
REPLACE_COMMIT |
| Modifier and Type | Method and Description |
|---|---|
static HoodieCDCInferenceCase |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HoodieCDCInferenceCase[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HoodieCDCInferenceCase AS_IS
public static final HoodieCDCInferenceCase BASE_FILE_INSERT
public static final HoodieCDCInferenceCase BASE_FILE_DELETE
public static final HoodieCDCInferenceCase LOG_FILE
public static final HoodieCDCInferenceCase REPLACE_COMMIT
public static HoodieCDCInferenceCase[] values()
for (HoodieCDCInferenceCase c : HoodieCDCInferenceCase.values()) System.out.println(c);
public static HoodieCDCInferenceCase valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2024 The Apache Software Foundation. All rights reserved.