public class TableEnvironment extends Object
This can be used to convert DataSet
or DataStream
to a Table
and back again. You
can also use the provided methods to create a Table
directly from a data source.
Constructor and Description |
---|
TableEnvironment() |
Modifier and Type | Method and Description |
---|---|
<T> Table |
fromDataSet(DataSet<T> set)
Transforms the given DataSet to a
Table . |
<T> Table |
fromDataSet(DataSet<T> set,
String fields)
Transforms the given DataSet to a
Table . |
<T> Table |
fromDataStream(DataStream<T> set)
Transforms the given DataStream to a
Table . |
<T> Table |
fromDataStream(DataStream<T> set,
String fields)
Transforms the given DataStream to a
Table . |
<T> DataSet<T> |
toDataSet(Table table,
Class<T> clazz)
Converts the given
Table to
a DataSet. |
<T> DataStream<T> |
toDataStream(Table table,
Class<T> clazz)
Converts the given
Table to
a DataStream. |
public <T> Table fromDataSet(DataSet<T> set, String fields)
Table
.
The fields of the DataSet type are renamed to the given set of fields:
Example:
tableEnv.fromDataSet(set, "a, b")
This will transform the set containing elements of two fields to a table where the fields are named a and b.
public <T> Table fromDataStream(DataStream<T> set, String fields)
Table
.
The fields of the DataStream type are renamed to the given set of fields:
Example:
tableEnv.fromDataStream(set, "a, b")
This will transform the set containing elements of two fields to a table where the fields are named a and b.
public <T> Table fromDataStream(DataStream<T> set)
public <T> DataStream<T> toDataStream(Table table, Class<T> clazz)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.