use of org.apache.storm.sql.calcite.ParallelStreamableTable in project storm by apache.
the class TridentScanRule method convert.
@Override
public RelNode convert(RelNode rel) {
final TableScan scan = (TableScan) rel;
int parallelismHint = DEFAULT_PARALLELISM_HINT;
final ParallelStreamableTable parallelTable = scan.getTable().unwrap(ParallelStreamableTable.class);
if (parallelTable != null && parallelTable.parallelismHint() != null) {
parallelismHint = parallelTable.parallelismHint();
}
final Table table = scan.getTable().unwrap(Table.class);
switch(table.getJdbcTableType()) {
case STREAM:
return new TridentStreamScanRel(scan.getCluster(), scan.getTraitSet().replace(TridentLogicalConvention.INSTANCE), scan.getTable(), parallelismHint);
default:
throw new IllegalArgumentException(String.format("Unsupported table type: %s", table.getJdbcTableType()));
}
}
Aggregations