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));
}
Aggregations