public class DataSetConversions<T> extends Object
DataSet
to a Table
. A DataSet
is
wrapped in this by the implicit conversions in org.apache.flink.api.scala.table
.Constructor and Description |
---|
DataSetConversions(DataSet<T> set,
CompositeType<T> inputType) |
Modifier and Type | Method and Description |
---|---|
Table |
as(scala.collection.Seq<Expression> fields)
Converts the
DataSet to a Table . |
Table |
toTable()
Converts the
DataSet to a Table . |
public DataSetConversions(DataSet<T> set, CompositeType<T> inputType)
public Table as(scala.collection.Seq<Expression> fields)
DataSet
to a Table
. The field names can be specified like this:
val in: DataSet[(String, Int)] = ...
val table = in.as('a, 'b)
This results in a Table
that has field a
of type String
and field b
of type Int
.
public Table toTable()
DataSet
to a Table
. The field names will be taken from the field names
of the input type.
Example:
val in: DataSet[(String, Int)] = ...
val table = in.toTable
Here, the result is a Table
that has field _1
of type String
and field _2
of type Int
.
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.