0

DynamicFiltersPrestoSql 中的功能是什么DistributedExecutionPlanner.Visitor

private Map<PlanNodeId, SplitSource> visitScanAndFilter(TableScanNode node, Optional<FilterNode> filter)
    {
        // ***What's the purpose of dynamicFilters and how to use it?***
        List<DynamicFilters.Descriptor> dynamicFilters = filter
                .map(FilterNode::getPredicate)
                .map(expression -> extractDynamicFilters(metadata, expression))
                .map(DynamicFilters.ExtractResult::getDynamicConjuncts)
                .orElse(ImmutableList.of());

        // TODO: Execution must be plugged in here 
        if (!dynamicFilters.isEmpty()) {
            log.debug("Dynamic filters: %s", dynamicFilters);
        }

        // get dataSource for table
        SplitSource splitSource = splitManager.getSplits(
                session,
                node.getTable(),
                stageExecutionDescriptor.isScanGroupedExecution(node.getId()) ? GROUPED_SCHEDULING : UNGROUPED_SCHEDULING);

        splitSources.add(splitSource);

        return ImmutableMap.of(node.getId(), splitSource);
    }
4

1 回答 1

1

正如 Martin 所建议的,https://trino.io/blog/2019/06/30/dynamic-filtering.html描述了动态过滤器的含义。

代码中的 TODO 在那里,因为尚未实现此功能的每个部分。您可以跟踪https://github.com/trino/presto/issues/52

于 2020-03-02T07:52:32.123 回答