public class DataSetConversions<T> extends Object
DataSet
into a Table
.
Constructor and Description |
---|
DataSetConversions(DataSet<T> dataSet,
TypeInformation<T> inputType) |
Modifier and Type | Method and Description |
---|---|
Table |
toTable(BatchTableEnvironment tableEnv,
scala.collection.Seq<Expression> fields)
Converts the
DataSet into a Table . |
public DataSetConversions(DataSet<T> dataSet, TypeInformation<T> inputType)
public Table toTable(BatchTableEnvironment tableEnv, scala.collection.Seq<Expression> fields)
DataSet
into a Table
.
The field name of the new Table
can be specified like this:
val env = ExecutionEnvironment.getExecutionEnvironment
val tEnv = TableEnvironment.getTableEnvironment(env)
val set: DataSet[(String, Int)] = ...
val table = set.toTable(tEnv, 'name, 'amount)
If not explicitly specified, field names are automatically extracted from the type of
the DataSet
.
tableEnv
- The BatchTableEnvironment
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.