use of org.apache.calcite.rel.logical.LogicalExchange in project calcite by apache.
the class RelMetadataTest method testDistributionHashEmpty.
@Test
public void testDistributionHashEmpty() {
final RelNode rel = convertSql("select * from emp");
final RelDistribution dist = RelDistributions.hash(ImmutableList.<Integer>of());
final LogicalExchange exchange = LogicalExchange.create(rel, dist);
final RelMetadataQuery mq = RelMetadataQuery.instance();
RelDistribution d = mq.getDistribution(exchange);
assertThat(d, is(dist));
}
use of org.apache.calcite.rel.logical.LogicalExchange in project calcite by apache.
the class RelMetadataTest method testDistributionHash.
@Test
public void testDistributionHash() {
final RelNode rel = convertSql("select * from emp");
final RelDistribution dist = RelDistributions.hash(ImmutableList.of(1));
final LogicalExchange exchange = LogicalExchange.create(rel, dist);
final RelMetadataQuery mq = RelMetadataQuery.instance();
RelDistribution d = mq.getDistribution(exchange);
assertThat(d, is(dist));
}
use of org.apache.calcite.rel.logical.LogicalExchange in project calcite by apache.
the class RelMetadataTest method testDistributionSingleton.
@Test
public void testDistributionSingleton() {
final RelNode rel = convertSql("select * from emp");
final RelDistribution dist = RelDistributions.SINGLETON;
final LogicalExchange exchange = LogicalExchange.create(rel, dist);
final RelMetadataQuery mq = RelMetadataQuery.instance();
RelDistribution d = mq.getDistribution(exchange);
assertThat(d, is(dist));
}
Aggregations