public class Json
extends org.apache.flink.table.descriptors.FormatDescriptor
Constructor and Description |
---|
Json()
Format descriptor for JSON.
|
Modifier and Type | Method and Description |
---|---|
void |
addFormatProperties(org.apache.flink.table.descriptors.DescriptorProperties properties)
Internal method for format properties conversion.
|
Json |
deriveSchema()
Derives the format schema from the table's schema described using
Schema . |
Json |
failOnMissingField(boolean failOnMissingField)
Sets flag whether to fail if a field is missing or not.
|
Json |
jsonSchema(String jsonSchema)
Sets the JSON schema string with field names and the types according to the JSON schema
specification [[http://json-schema.org/specification.html]].
|
Json |
schema(TypeInformation<Row> schemaType)
Sets the schema using type information.
|
public Json failOnMissingField(boolean failOnMissingField)
failOnMissingField
- If set to true, the operation fails if there is a missing field.
If set to false, a missing field is set to null.public Json jsonSchema(String jsonSchema)
The schema might be nested.
jsonSchema
- JSON schemapublic Json schema(TypeInformation<Row> schemaType)
JSON objects are represented as ROW types.
The schema might be nested.
schemaType
- type information that describes the schemapublic Json deriveSchema()
Schema
.
This allows for defining schema information only once.
The names, types, and field order of the format are determined by the table's schema. Time attributes are ignored if their origin is not a field. A "from" definition is interpreted as a field renaming in the format.
public void addFormatProperties(org.apache.flink.table.descriptors.DescriptorProperties properties)
addFormatProperties
in class org.apache.flink.table.descriptors.FormatDescriptor
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.