use of io.ordinate.engine.function.bind.VariableParameterFunction in project Mycat2 by MyCATApache.
the class CalciteCompiler method convertCorrelate.
public CorrelateJoinPlan convertCorrelate(Correlate correlate) {
PhysicalPlan left = convert(correlate.getLeft());
PhysicalPlan right = convert(correlate.getRight());
CorrelationId correlationId = correlate.getCorrelationId();
List<Integer> requireList = correlate.getRequiredColumns().asList();
Map<CorrelationKey, List<VariableParameterFunction>> map = rexConverter.getVariableParameterFunctionMap();
List<Map.Entry<CorrelationKey, List<VariableParameterFunction>>> entryList = map.entrySet().stream().filter(i -> i.getKey().correlationId.getId() == correlationId.getId()).collect(Collectors.toList());
HashMap<Integer, List<VariableParameterFunction>> targetMap = new HashMap<>();
for (Map.Entry<CorrelationKey, List<VariableParameterFunction>> e : entryList) {
int index = e.getKey().index;
Integer integer = requireList.get(index);
for (VariableParameterFunction variableParameterFunction : e.getValue()) {
targetMap.compute(integer, (integer1, variableParameterFunctions) -> new ArrayList<>()).add(variableParameterFunction);
}
}
return new CorrelateJoinPlan(left, right, JoinType.valueOf(correlate.getJoinType().name()), targetMap);
}
Aggregations