Class DataIndexPushdownManager
java.lang.Object
io.deephaven.engine.table.impl.dataindex.DataIndexPushdownManager
- All Implemented Interfaces:
PushdownFilterMatcher,PushdownPredicateManager
A
PushdownPredicateManager that supports pushdown against a DataIndex. This manager can wrap an
existing PushdownFilterMatcher to allow efficient fallback if the DataIndex pushdown is not effective or when
the cost ceiling is too low to use the DataIndex.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidestimatePushdownFilterCost(@NotNull WhereFilter filter, @NotNull RowSet selection, boolean usePrev, @NotNull PushdownFilterContext context, @NotNull JobScheduler jobScheduler, @NotNull LongConsumer onComplete, @NotNull Consumer<Exception> onError) Estimate the cost of pushing down the next pushdown filter.makePushdownFilterContext(@NotNull WhereFilter filter, @NotNull List<ColumnSource<?>> filterSources) Create a pushdown filter context for this entity.voidpushdownFilter(@NotNull WhereFilter filter, @NotNull RowSet selection, boolean usePrev, @NotNull PushdownFilterContext context, long costCeiling, @NotNull JobScheduler jobScheduler, @NotNull Consumer<PushdownResult> onComplete, @NotNull Consumer<Exception> onError) Push down the given filter to the underlying table and pass the result to the consumer.static PushdownFilterMatcherwrap(@NotNull DataIndex dataIndex, PushdownFilterMatcher wrapped) Create newDataIndexPushdownManagerfor aDataIndex, wrapping aPushdownFilterMatcherto be used when the index would not be efficient.
-
Method Details
-
estimatePushdownFilterCost
public void estimatePushdownFilterCost(@NotNull @NotNull WhereFilter filter, @NotNull @NotNull RowSet selection, boolean usePrev, @NotNull @NotNull PushdownFilterContext context, @NotNull @NotNull JobScheduler jobScheduler, @NotNull @NotNull LongConsumer onComplete, @NotNull @NotNull Consumer<Exception> onError) Description copied from interface:PushdownFilterMatcherEstimate the cost of pushing down the next pushdown filter. This returns a unitless value to compare the cost of executing different filters. Common costs are listed inPushdownResult(such asPushdownResult.METADATA_STATS_COST) and should be used as a baseline for estimating the cost of newly implemented pushdown operations.A no-op implementation should simply complete with
Long.MAX_VALUE.- Specified by:
estimatePushdownFilterCostin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto test.selection- The set of rows to tests.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto use for the pushdown operation.jobScheduler- The job scheduler to use for scheduling child jobsonComplete- Consumer of the estimated cost of the pushdown operation. 9223372036854775807L indicates that the filter cannot be pushed down.onError- Consumer of any exceptions that occur during the estimate operation
-
pushdownFilter
public void pushdownFilter(@NotNull @NotNull WhereFilter filter, @NotNull @NotNull RowSet selection, boolean usePrev, @NotNull @NotNull PushdownFilterContext context, long costCeiling, @NotNull @NotNull JobScheduler jobScheduler, @NotNull @NotNull Consumer<PushdownResult> onComplete, @NotNull @NotNull Consumer<Exception> onError) Description copied from interface:PushdownFilterMatcherPush down the given filter to the underlying table and pass the result to the consumer. This method is expected to execute all pushdown filter steps that are greater thanPushdownFilterContext.executedFilterCost()and less than or equal tocostCeiling.The resulting
PushdownResult(toonComplete) must only contain rows fromselection. Thematch row setare rows that are guaranteed to match. The implicitly "missing" rowsselection - match - maybeMatchare rows that are guaranteed to not match. The remainingmaybe match row setare rows that may, or may not, match. The pushdown result ownership passes toonComplete.A no-op implementation should simply complete with
PushdownResult.maybeMatch(selection).- Specified by:
pushdownFilterin interfacePushdownFilterMatcher- Parameters:
filter- Thefilterto apply.selection- The set of rows to test.usePrev- Whether to use the previous resultcontext- ThePushdownFilterContextto use for the pushdown operation.costCeiling- Execute all possible filters with a cost less than or equal this value.jobScheduler- The job scheduler to use for scheduling child jobsonComplete- Consumer of the output rowsets for added and modified rows that pass the filteronError- Consumer of any exceptions that occur during the pushdown operation
-
makePushdownFilterContext
public PushdownFilterContext makePushdownFilterContext(@NotNull @NotNull WhereFilter filter, @NotNull @NotNull List<ColumnSource<?>> filterSources) Description copied from interface:PushdownFilterMatcherCreate a pushdown filter context for this entity.- Specified by:
makePushdownFilterContextin interfacePushdownFilterMatcher- Parameters:
filter- the filter to use while making the contextfilterSources- the column sources that match the filter column names- Returns:
- the created filter context
-
wrap
public static PushdownFilterMatcher wrap(@NotNull @NotNull DataIndex dataIndex, PushdownFilterMatcher wrapped) Create newDataIndexPushdownManagerfor aDataIndex, wrapping aPushdownFilterMatcherto be used when the index would not be efficient.- Parameters:
dataIndex- theDataIndexto use for pushdownwrapped- the wrappedPushdownFilterMatcher- Returns:
- a new
PushdownFilterMatchersupporting DataIndex pushdown, ornullif pushdown is not supported
-