Search in sources :

Example 1 with StreamsScanTupleValueMapper

use of org.apache.storm.sql.runtime.streams.functions.StreamsScanTupleValueMapper in project storm by apache.

the class StreamsStreamScanRel method streamsPlan.

@Override
public void streamsPlan(StreamsPlanCreator planCreator) throws Exception {
    String sourceName = Joiner.on('.').join(getTable().getQualifiedName());
    Map<String, ISqlStreamsDataSource> sources = planCreator.getSources();
    if (!sources.containsKey(sourceName)) {
        throw new RuntimeException("Cannot find table " + sourceName);
    }
    List<String> fieldNames = getRowType().getFieldNames();
    final Stream<Values> finalStream = planCreator.getStreamBuilder().newStream(sources.get(sourceName).getProducer(), new StreamsScanTupleValueMapper(fieldNames), parallelismHint);
    planCreator.addStream(finalStream);
}
Also used : ISqlStreamsDataSource(org.apache.storm.sql.runtime.ISqlStreamsDataSource) Values(org.apache.storm.tuple.Values) StreamsScanTupleValueMapper(org.apache.storm.sql.runtime.streams.functions.StreamsScanTupleValueMapper)

Aggregations

ISqlStreamsDataSource (org.apache.storm.sql.runtime.ISqlStreamsDataSource)1 StreamsScanTupleValueMapper (org.apache.storm.sql.runtime.streams.functions.StreamsScanTupleValueMapper)1 Values (org.apache.storm.tuple.Values)1