use of herddb.model.planner.ThetaJoinOp in project herddb by diennea.
the class CalcitePlanner method planEnumerableThetaJoin.
private PlannerOp planEnumerableThetaJoin(EnumerableThetaJoin op, RelDataType rowType) {
PlannerOp left = convertRelNode(op.getLeft(), null, false);
PlannerOp right = convertRelNode(op.getRight(), null, false);
CompiledSQLExpression condition = SQLExpressionCompiler.compileExpression(op.getCondition());
boolean generateNullsOnLeft = op.getJoinType().generatesNullsOnLeft();
boolean generateNullsOnRight = op.getJoinType().generatesNullsOnRight();
final RelDataType _rowType = rowType == null ? op.getRowType() : rowType;
List<RelDataTypeField> fieldList = _rowType.getFieldList();
Column[] columns = new Column[fieldList.size()];
String[] fieldNames = new String[columns.length];
int i = 0;
for (RelDataTypeField field : fieldList) {
Column col = Column.column(field.getName().toLowerCase(), convertToHerdType(field.getType()));
fieldNames[i] = col.name;
columns[i++] = col;
}
return new ThetaJoinOp(fieldNames, columns, left, right, condition, generateNullsOnLeft, generateNullsOnRight, false);
}
Aggregations