Package org.apache.flink.formats.json
Class JsonRowDeserializationSchema.Builder
- java.lang.Object
-
- org.apache.flink.formats.json.JsonRowDeserializationSchema.Builder
-
- Enclosing class:
- JsonRowDeserializationSchema
public static class JsonRowDeserializationSchema.Builder extends Object
Builder forJsonRowDeserializationSchema
.
-
-
Constructor Summary
Constructors Constructor Description Builder(String jsonSchema)
Creates a JSON deserialization schema for the given JSON schema.Builder(TypeInformation<Row> typeInfo)
Creates a JSON deserialization schema for the given type information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonRowDeserializationSchema
build()
JsonRowDeserializationSchema.Builder
failOnMissingField()
Configures schema to fail if a JSON field is missing.JsonRowDeserializationSchema.Builder
ignoreParseErrors()
Configures schema to fail when parsing json failed.
-
-
-
Constructor Detail
-
Builder
public Builder(TypeInformation<Row> typeInfo)
Creates a JSON deserialization schema for the given type information.- Parameters:
typeInfo
- Type information describing the result type. The field names ofRow
are used to parse the JSON properties.
-
Builder
public Builder(String jsonSchema)
Creates a JSON deserialization schema for the given JSON schema.- Parameters:
jsonSchema
- JSON schema describing the result type- See Also:
- http://json-schema.org/
-
-
Method Detail
-
failOnMissingField
public JsonRowDeserializationSchema.Builder failOnMissingField()
Configures schema to fail if a JSON field is missing.By default, a missing field is ignored and the field is set to null.
-
ignoreParseErrors
public JsonRowDeserializationSchema.Builder ignoreParseErrors()
Configures schema to fail when parsing json failed.By default, an exception will be thrown when parsing json fails.
-
build
public JsonRowDeserializationSchema build()
-
-