T
- Type of the KafkaJsonTableSource produced by the builder.B
- Type of the KafkaJsonTableSource.Builder subclass.protected abstract static class KafkaJsonTableSource.Builder<T extends KafkaJsonTableSource,B extends KafkaJsonTableSource.Builder> extends KafkaTableSource.Builder<T,B>
KafkaJsonTableSource
to be extended by builders of subclasses of
KafkaJsonTableSource.Modifier | Constructor and Description |
---|---|
protected |
Builder() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureTableSource(T source)
Configures a TableSource with optional parameters.
|
B |
failOnMissingField(boolean failOnMissingField)
Sets flag whether to fail if a field is missing or not.
|
B |
forJsonSchema(org.apache.flink.table.api.TableSchema jsonSchema)
Sets the schema of the JSON-encoded Kafka messages.
|
protected org.apache.flink.table.api.TableSchema |
getJsonSchema()
Returns the configured JSON schema.
|
B |
withTableToJsonMapping(Map<String,String> tableToJsonMapping)
Sets a mapping from schema fields to fields of the JSON schema.
|
build, builder, forTopic, fromEarliest, fromGroupOffsets, fromLatest, fromSpecificOffsets, getKafkaProps, getTableSchema, getTopic, supportsKafkaTimestamps, withKafkaProperties, withKafkaTimestampAsRowtimeAttribute, withProctimeAttribute, withRowtimeAttribute, withSchema
public B forJsonSchema(org.apache.flink.table.api.TableSchema jsonSchema)
jsonSchema
- The schema of the JSON-encoded Kafka messages.public B withTableToJsonMapping(Map<String,String> tableToJsonMapping)
A field mapping is required if the fields of produced tables should be named different than the fields of the JSON records. The key of the provided Map refers to the field of the table schema, the value to the field in the JSON schema.
tableToJsonMapping
- A mapping from table schema fields to JSON schema fields.public B failOnMissingField(boolean failOnMissingField)
failOnMissingField
- If set to true, the TableSource fails if a missing fields.
If set to false, a missing field is set to null.protected org.apache.flink.table.api.TableSchema getJsonSchema()
protected void configureTableSource(T source)
KafkaTableSource.Builder
configureTableSource
in class KafkaTableSource.Builder<T extends KafkaJsonTableSource,B extends KafkaJsonTableSource.Builder>
source
- The TableSource to configure.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.