public static class StreamSQLTestProgram.GeneratorTableSource extends Object implements StreamTableSource<Row>, DefinedRowtimeAttributes, DefinedFieldMapping
Constructor and Description |
---|
GeneratorTableSource(int numKeys,
float recordsPerKeyAndSecond,
int durationSeconds,
int offsetSeconds) |
Modifier and Type | Method and Description |
---|---|
String |
explainSource()
Describes the table source.
|
DataStream<Row> |
getDataStream(StreamExecutionEnvironment execEnv)
Returns the data of the table as a
DataStream . |
Map<String,String> |
getFieldMapping()
Returns the mapping for the fields of the
TableSource 's TableSchema to the
fields of its produced DataType . |
TypeInformation<Row> |
getReturnType() |
List<RowtimeAttributeDescriptor> |
getRowtimeAttributeDescriptors()
Returns a list of
RowtimeAttributeDescriptor for all rowtime attributes of the table. |
TableSchema |
getTableSchema()
Returns the schema of the produced table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isBounded
getProducedDataType
public GeneratorTableSource(int numKeys, float recordsPerKeyAndSecond, int durationSeconds, int offsetSeconds)
public DataStream<Row> getDataStream(StreamExecutionEnvironment execEnv)
StreamTableSource
DataStream
.
NOTE: This method is for internal use only for defining a TableSource
. Do not use
it in Table API programs.
getDataStream
in interface StreamTableSource<Row>
public TypeInformation<Row> getReturnType()
getReturnType
in interface TableSource<Row>
public TableSchema getTableSchema()
TableSource
getTableSchema
in interface TableSource<Row>
TableSchema
of the produced table.public String explainSource()
TableSource
explainSource
in interface TableSource<Row>
TableSource
.public List<RowtimeAttributeDescriptor> getRowtimeAttributeDescriptors()
DefinedRowtimeAttributes
RowtimeAttributeDescriptor
for all rowtime attributes of the table.
All referenced attributes must be present in the TableSchema
of the TableSource
and of type Types.SQL_TIMESTAMP
.
getRowtimeAttributeDescriptors
in interface DefinedRowtimeAttributes
RowtimeAttributeDescriptor
.public Map<String,String> getFieldMapping()
DefinedFieldMapping
TableSource
's TableSchema
to the
fields of its produced DataType
.
The mapping is done based on field names, e.g., a mapping "name" -> "f1" maps the schema
field "name" to the field "f1" of the produced data type, for example in this case the second
field of a Tuple
.
The returned mapping must map all fields (except proctime and rowtime fields) to the
produced data type. It can also provide a mapping for fields which are not in the TableSchema
to make fields in the physical DataType
accessible for a TimestampExtractor
.
getFieldMapping
in interface DefinedFieldMapping
TableSchema
fields to DataType
fields or null if no
mapping is necessary.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.