final ObjectNode join = implementor.mapper.createObjectNode();
join.put("op", "join");
join.put("left", leftId);
join.put("right", rightId);
join.put("type", toDrill(joinType));
final ArrayNode conditions = implementor.mapper.createArrayNode();
join.put("conditions", conditions);
for (Pair<Integer, Integer> pair : Pair.zip(leftKeys, rightKeys)) {
final ObjectNode condition = implementor.mapper.createObjectNode();
condition.put("relationship", "==");
condition.put("left", leftFields.get(pair.left));
condition.put("right", rightFields.get(pair.right));
conditions.add(condition);
}
return implementor.add(join);
}