public class DataStreamConversions<T> extends Object
Constructor and Description |
---|
DataStreamConversions(DataStream<T> stream,
CompositeType<T> inputType) |
Modifier and Type | Method and Description |
---|---|
Table |
as(scala.collection.Seq<Expression> fields)
Converts the
DataStream to a Table . |
Table |
toTable()
Converts the
DataStream to a Table . |
public DataStreamConversions(DataStream<T> stream, CompositeType<T> inputType)
public Table as(scala.collection.Seq<Expression> fields)
DataStream
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()
DataStream
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
This results in 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.