Search in sources :

Example 1 with LocalDynamicFilter

use of io.prestosql.sql.planner.LocalDynamicFilter in project hetu-core by openlookeng.

the class TestDynamicFilterSourceOperator method createOperatorFactory.

private DynamicFilterSourceOperatorFactory createOperatorFactory(DynamicFilter.Type dfType, FeaturesConfig.DynamicFilterDataType dataType, int partitionCount, Channel... buildChannels) {
    NodeInfo nodeInfo = new NodeInfo("test");
    Multimap<String, Symbol> probeSymbols = MultimapBuilder.treeKeys().arrayListValues().build();
    Map<String, Integer> buildChannelMap = new HashMap<>();
    Arrays.stream(buildChannels).map(channel -> buildChannelMap.put(channel.getFilterId(), channel.getIndex()));
    Arrays.stream(buildChannels).map(channel -> probeSymbols.put(channel.getFilterId(), new Symbol(String.valueOf(channel.getIndex()))));
    TaskId taskId = new TaskId("test0.0");
    LocalDynamicFilter localDynamicFilter = new LocalDynamicFilter(probeSymbols, buildChannelMap, partitionCount, dfType, dataType, 0.1D, taskId, stateStoreProvider);
    return new DynamicFilterSourceOperatorFactory(0, new PlanNodeId("PLAN_NODE_ID"), localDynamicFilter.getValueConsumer(), Arrays.stream(buildChannels).collect(toList()), getDynamicFilteringMaxPerDriverValueCount(TEST_SESSION), getDynamicFilteringMaxPerDriverSize(TEST_SESSION));
}
Also used : PlanNodeId(io.prestosql.spi.plan.PlanNodeId) TaskId(io.prestosql.execution.TaskId) HashMap(java.util.HashMap) NodeInfo(io.airlift.node.NodeInfo) Symbol(io.prestosql.spi.plan.Symbol) LocalDynamicFilter(io.prestosql.sql.planner.LocalDynamicFilter) DynamicFilterSourceOperatorFactory(io.prestosql.operator.DynamicFilterSourceOperator.DynamicFilterSourceOperatorFactory)

Aggregations

NodeInfo (io.airlift.node.NodeInfo)1 TaskId (io.prestosql.execution.TaskId)1 DynamicFilterSourceOperatorFactory (io.prestosql.operator.DynamicFilterSourceOperator.DynamicFilterSourceOperatorFactory)1 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)1 Symbol (io.prestosql.spi.plan.Symbol)1 LocalDynamicFilter (io.prestosql.sql.planner.LocalDynamicFilter)1 HashMap (java.util.HashMap)1