public abstract class KafkaJsonTableSource extends Object
StreamTableSource
.
The version-specific Kafka consumers need to extend this class and
override getKafkaConsumer(String, Properties, DeserializationSchema)
}.
The field names are used to parse the JSON file and so are the types.
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 . |
void |
setFailOnMissingField(boolean failOnMissingField)
Configures the failure behaviour if a JSON field is missing.
|
public void setFailOnMissingField(boolean failOnMissingField)
By default, a missing field is ignored and the field is set to null.
failOnMissingField
- Flag indicating whether to fail or not on a missing field.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.