use of io.dingodb.calcite.rel.DingoDistributedValues 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);
}
use of io.dingodb.calcite.rel.DingoDistributedValues in project dingo by dingodb.
the class DingoDistributedValuesRule method onMatch.
@Override
public void onMatch(@Nonnull RelOptRuleCall call) {
DingoTableModify modify = call.rel(0);
Values values = call.rel(1);
RelOptCluster cluster = modify.getCluster();
RelOptTable table = modify.getTable();
call.transformTo(new DingoPartModify(cluster, modify.getTraitSet().replace(DingoConventions.DISTRIBUTED), new DingoDistributedValues(cluster, values.getRowType(), values.getTuples(), values.getTraitSet().replace(DingoConventions.DISTRIBUTED), table), table, modify.getOperation(), modify.getUpdateColumnList(), modify.getSourceExpressionList()));
}
Aggregations