org.apache.calcite.adapter.enumerable.EnumerableJoin Java Examples

The following examples show how to use org.apache.calcite.adapter.enumerable.EnumerableJoin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OLAPJoinRel.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Override
public EnumerableJoin copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, //
        JoinRelType joinType, boolean semiJoinDone) {

    final JoinInfo joinInfo = JoinInfo.of(left, right, condition);
    assert joinInfo.isEqui();
    try {
        return new OLAPJoinRel(getCluster(), traitSet, left, right, condition, joinInfo.leftKeys,
                joinInfo.rightKeys, variablesSet, joinType);
    } catch (InvalidRelException e) {
        // Semantic error not possible. Must be a bug. Convert to internal error.
        throw new AssertionError(e);
    }
}
 
Example #2
Source File: JoinQueryExecutor.java    From sql-gremlin with Apache License 2.0 5 votes vote down vote up
public JoinQueryExecutor(final RelNode node,
                         final Map<EnumerableJoin, Map<String, GremlinToEnumerableConverter>> fieldMap,
                         GraphTraversal<?, ?> traversal, Map<GremlinToEnumerableConverter, String> tableIdMap) {
    this.node = node;
    this.fieldMap = fieldMap;
    this.traversal = traversal;
    this.tableIdMap = tableIdMap;
}
 
Example #3
Source File: FieldMapVisitor.java    From sql-gremlin with Apache License 2.0 5 votes vote down vote up
private GremlinToEnumerableConverter getConverter(int fieldIndex, String field, RelNode node) {
    if(node instanceof EnumerableJoin) {
        final EnumerableJoin join = (EnumerableJoin) node;
        List<String> fieldNames = join.getRowType().getFieldNames();
        final String chosenField = fieldNames.get(fieldIndex);
        return fieldMap.get(join).get(chosenField);
    }
    return null;
}
 
Example #4
Source File: OLAPJoinRel.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Override
public EnumerableJoin copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, //
        JoinRelType joinType, boolean semiJoinDone) {

    final JoinInfo joinInfo = JoinInfo.of(left, right, condition);
    assert joinInfo.isEqui();
    try {
        return new OLAPJoinRel(getCluster(), traitSet, left, right, condition, joinInfo.leftKeys,
                joinInfo.rightKeys, variablesSet, joinType);
    } catch (InvalidRelException e) {
        // Semantic error not possible. Must be a bug. Convert to internal error.
        throw new AssertionError(e);
    }
}
 
Example #5
Source File: FieldMapVisitor.java    From sql-gremlin with Apache License 2.0 4 votes vote down vote up
public Map<EnumerableJoin, Map<String, GremlinToEnumerableConverter>> getFieldMap() {
    return fieldMap;
}
 
Example #6
Source File: TraversalVisitor.java    From sql-gremlin with Apache License 2.0 4 votes vote down vote up
public TraversalVisitor(GraphTraversalSource traversalSource,
                        Map<GremlinToEnumerableConverter, List<RelNode>> scanMap,
                        Map<EnumerableJoin, Map<String, GremlinToEnumerableConverter>> fieldMap) {
    this.scanMap = scanMap;
    this.fieldMap = fieldMap;
}