public class IncrementalQueryAnalyzer extends Object
The analyzer is supplied the following information:
| Query Range | File selection criteria | Instant filtering predicate applied to selected files |
|---|---|---|
| [earliest, +INF] | The latest snapshot files from table metadata | _ |
| [earliest, endTime] | The latest snapshot files from table metadata | '_hoodie_commit_time' in setA, setA contains the begin instant times for actions completed before or on 'endTime' |
| [-INF, +INF] | The latest completed instant metadata | '_hoodie_commit_time' = i_n, i_n is the latest completed instant |
| [-INF, endTime] | I) find the last completed instant i_n before or on 'endTime; II) read the latest snapshot from table metadata if i_n is archived or the commit metadata if it is still active | '_hoodie_commit_time' = i_n |
| [startTime, +INF] | i).find the instant set setA, setA is a collection of all the instants completed after or on 'startTime'; ii). read the latest snapshot from table metadata if setA has archived instants or the commit metadata if all the instants are still active | '_hoodie_commit_time' in setA |
| [earliest, endTime] | i).find the instant set setA, setA is a collection of all the instants completed in the given time range; ii). read the latest snapshot from table metadata if setA has archived instants or the commit metadata if all the instants are still active | '_hoodie_commit_time' in setA |
A RangeType is required for analyzing the query so that the query range boundary inclusiveness have clear semantics.
IMPORTANT: the reader may optionally choose to fall back to reading the latest snapshot if there are files decoding the commit metadata are already cleaned.
| Modifier and Type | Class and Description |
|---|---|
static class |
IncrementalQueryAnalyzer.Builder
Builder for
IncrementalQueryAnalyzer. |
static class |
IncrementalQueryAnalyzer.QueryContext
Represents the analyzed query context.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
START_COMMIT_EARLIEST |
| Modifier and Type | Method and Description |
|---|---|
IncrementalQueryAnalyzer.QueryContext |
analyze()
Analyzes the incremental query context with given completion time range.
|
static IncrementalQueryAnalyzer.Builder |
builder()
Returns a builder.
|
static HoodieTimeline |
filterInstantsAsPerUserConfigs(HoodieTableMetaClient metaClient,
HoodieTimeline timeline,
boolean skipCompaction,
boolean skipClustering,
boolean skipInsertOverwrite)
Filters out the unnecessary instants as per user specified configs.
|
public static final String START_COMMIT_EARLIEST
public static IncrementalQueryAnalyzer.Builder builder()
public IncrementalQueryAnalyzer.QueryContext analyze()
public static HoodieTimeline filterInstantsAsPerUserConfigs(HoodieTableMetaClient metaClient, HoodieTimeline timeline, boolean skipCompaction, boolean skipClustering, boolean skipInsertOverwrite)
timeline - The timeline.Copyright © 2024 The Apache Software Foundation. All rights reserved.