use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelRoot in project dingo by dingodb.
the class TestLogicalPlan method parse.
private static RelRoot parse(String sql) throws SqlParseException {
SqlNode sqlNode = parser.parse(sql);
sqlNode = parser.validate(sqlNode);
RelRoot relRoot = parser.convert(sqlNode);
log.info("relRoot = {}", relRoot);
return relRoot;
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelRoot in project dingo by dingodb.
the class TestLogicalPlan method testProjectScan.
@Test
public void testProjectScan() throws SqlParseException {
String sql = "select name, amount from test";
RelRoot relRoot = parse(sql);
Assert.relNode(relRoot.rel).isA(LogicalProject.class).convention(Convention.NONE).singleInput().isA(DingoTableScan.class).convention(DingoConventions.DINGO);
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelRoot in project dingo by dingodb.
the class TestLogicalPlan method testSimple.
@Test
public void testSimple() throws SqlParseException {
String sql = "select 1";
RelRoot relRoot = parse(sql);
Assert.relNode(relRoot.rel).isA(LogicalValues.class).convention(Convention.NONE);
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelRoot in project dingo by dingodb.
the class TestLogicalPlan method testFilterScan.
@Test
public void testFilterScan() throws SqlParseException {
String sql = "select * from test where name = 'Alice' and amount > 3.0";
RelRoot relRoot = parse(sql);
Assert.relNode(relRoot.rel).isA(LogicalProject.class).convention(Convention.NONE).singleInput().isA(LogicalFilter.class).convention(Convention.NONE).singleInput().isA(DingoTableScan.class).convention(DingoConventions.DINGO);
}
use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.RelRoot in project dingo by dingodb.
the class TestLogicalPlan method testUpdate.
@Test
public void testUpdate() throws SqlParseException {
String sql = "update test set amount = 2.0 where id = 1";
RelRoot relRoot = parse(sql);
Assert.relNode(relRoot.rel).isA(LogicalTableModify.class).convention(Convention.NONE).prop("operation", TableModify.Operation.UPDATE).singleInput().isA(LogicalProject.class).convention(Convention.NONE).singleInput().isA(LogicalFilter.class).convention(Convention.NONE).singleInput().isA(DingoTableScan.class).convention(DingoConventions.DINGO);
}
Aggregations