public class Kafka08JsonTableSource extends KafkaJsonTableSource
StreamTableSource
for Kafka 0.8.Constructor and Description |
---|
Kafka08JsonTableSource(String topic,
Properties properties,
String[] fieldNames,
Class<?>[] fieldTypes)
Creates a Kafka 0.8 JSON
StreamTableSource . |
Kafka08JsonTableSource(String topic,
Properties properties,
String[] fieldNames,
TypeInformation<?>[] fieldTypes)
Creates a Kafka 0.8 JSON
StreamTableSource . |
Modifier and Type | Method and Description |
---|---|
DataStream<Row> |
getDataStream(StreamExecutionEnvironment env)
Returns the data of the table as a
DataStream . |
protected DeserializationSchema<Row> |
getDeserializationSchema()
Returns the deserialization schema.
|
String[] |
getFieldsNames()
Returns the names of the table fields.
|
TypeInformation<?>[] |
getFieldTypes()
Returns the types of the table fields.
|
int |
getNumberOfFields()
Returns the number of fields of the table.
|
TypeInformation<Row> |
getReturnType()
Returns the
TypeInformation for the return type of the TableSource . |
setFailOnMissingField
public Kafka08JsonTableSource(String topic, Properties properties, String[] fieldNames, TypeInformation<?>[] fieldTypes)
StreamTableSource
.topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.fieldNames
- Row field names.fieldTypes
- Row field types.public Kafka08JsonTableSource(String topic, Properties properties, String[] fieldNames, Class<?>[] fieldTypes)
StreamTableSource
.topic
- Kafka topic to consume.properties
- Properties for the Kafka consumer.fieldNames
- Row field names.fieldTypes
- Row field types.public DataStream<Row> getDataStream(StreamExecutionEnvironment env)
StreamTableSource
DataStream
.getDataStream
in interface StreamTableSource<Row>
public int getNumberOfFields()
TableSource
getNumberOfFields
in interface TableSource<Row>
public String[] getFieldsNames()
TableSource
getFieldsNames
in interface TableSource<Row>
public TypeInformation<?>[] getFieldTypes()
TableSource
getFieldTypes
in interface TableSource<Row>
public TypeInformation<Row> getReturnType()
TableSource
TypeInformation
for the return type of the TableSource
.getReturnType
in interface TableSource<Row>
protected DeserializationSchema<Row> getDeserializationSchema()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.