public class DataStreamConversions<T> extends Object
DataStream
into a Table
.
Constructor and Description |
---|
DataStreamConversions(DataStream<T> dataStream,
TypeInformation<T> inputType) |
Modifier and Type | Method and Description |
---|---|
Table |
toTable(StreamTableEnvironment tableEnv,
scala.collection.Seq<Expression> fields)
Converts the
DataStream into a Table . |
public DataStreamConversions(DataStream<T> dataStream, TypeInformation<T> inputType)
public Table toTable(StreamTableEnvironment tableEnv, scala.collection.Seq<Expression> fields)
DataStream
into a Table
.
The field name of the new Table
can be specified like this:
val env = StreamExecutionEnvironment.getExecutionEnvironment
val tEnv = TableEnvironment.getTableEnvironment(env)
val stream: DataStream[(String, Int)] = ...
val table = stream.toTable(tEnv, 'name, 'amount)
If not explicitly specified, field names are automatically extracted from the type of
the DataStream
.
tableEnv
- The StreamTableEnvironment
in which the new Table
is created.fields
- The field names of the new Table
(optional).Table
.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.