Search in sources :

Example 1 with DingoParser

use of io.dingodb.calcite.DingoParser in project dingo by dingodb.

the class TestDingoJobVisitor method setupAll.

@BeforeAll
public static void setupAll() {
    parser = new DingoParser(new DingoParserContext());
    table = parser.getContext().getCatalogReader().getTable(ImmutableList.of(FULL_TABLE_NAME));
    RelOptCluster cluster = parser.getCluster();
    RelDataTypeFactory typeFactory = parser.getContext().getTypeFactory();
    RelDataType rowType = typeFactory.createStructType(ImmutableList.of(typeFactory.createSqlType(SqlTypeName.INTEGER), typeFactory.createSqlType(SqlTypeName.VARCHAR, 64), typeFactory.createSqlType(SqlTypeName.DOUBLE)), ImmutableList.of("id", "name", "amount"));
    values = new DingoValues(cluster, rowType, ImmutableList.of(new Object[] { 1, "Alice", 1.0 }, new Object[] { 2, "Betty", 2.0 }), cluster.traitSetOf(DingoConventions.ROOT));
    distributedValues = new DingoDistributedValues(cluster, rowType, values.getTuples(), cluster.traitSetOf(DingoConventions.DISTRIBUTED), table);
}
Also used : RelOptCluster(org.apache.calcite.plan.RelOptCluster) DingoParser(io.dingodb.calcite.DingoParser) DingoParserContext(io.dingodb.calcite.DingoParserContext) DingoDistributedValues(io.dingodb.calcite.rel.DingoDistributedValues) RelDataTypeFactory(org.apache.calcite.rel.type.RelDataTypeFactory) RelDataType(org.apache.calcite.rel.type.RelDataType) DingoValues(io.dingodb.calcite.rel.DingoValues) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

DingoParser (io.dingodb.calcite.DingoParser)1 DingoParserContext (io.dingodb.calcite.DingoParserContext)1 DingoDistributedValues (io.dingodb.calcite.rel.DingoDistributedValues)1 DingoValues (io.dingodb.calcite.rel.DingoValues)1 RelOptCluster (org.apache.calcite.plan.RelOptCluster)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1