Search in sources :

Example 6 with EnumerableRelImplementor

use of org.apache.calcite.adapter.enumerable.EnumerableRelImplementor in project drill by apache.

the class CassandraEnumerablePrelContext method generateCode.

@Override
public String generateCode(RelOptCluster cluster, RelNode relNode) {
    RelNode enumerableRel = CassandraToEnumerableConverterRule.INSTANCE.convert(relNode);
    ClassDeclaration classDeclaration = new EnumerableRelImplementor(cluster.getRexBuilder(), Collections.emptyMap()).implementRoot((EnumerableRel) enumerableRel, EnumerableRel.Prefer.ARRAY);
    return Expressions.toString(Collections.singletonList(classDeclaration), "\n", false);
}
Also used : ClassDeclaration(org.apache.calcite.linq4j.tree.ClassDeclaration) RelNode(org.apache.calcite.rel.RelNode) EnumerableRelImplementor(org.apache.calcite.adapter.enumerable.EnumerableRelImplementor)

Aggregations

EnumerableRelImplementor (org.apache.calcite.adapter.enumerable.EnumerableRelImplementor)6 PhysType (org.apache.calcite.adapter.enumerable.PhysType)4 BlockBuilder (org.apache.calcite.linq4j.tree.BlockBuilder)4 Expression (org.apache.calcite.linq4j.tree.Expression)3 MethodCallExpression (org.apache.calcite.linq4j.tree.MethodCallExpression)3 RelDataType (org.apache.calcite.rel.type.RelDataType)3 Pair (org.apache.calcite.util.Pair)3 ClassDeclaration (org.apache.calcite.linq4j.tree.ClassDeclaration)2 RelNode (org.apache.calcite.rel.RelNode)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1