public class Json extends FormatDescriptor
Constructor and Description |
---|
Json()
Format descriptor for JSON.
|
Modifier and Type | Method and Description |
---|---|
Json |
deriveSchema()
Deprecated.
Derivation format schema from table's schema is the default behavior now. So
there is no need to explicitly declare to derive schema.
|
Json |
failOnMissingField(boolean failOnMissingField)
Sets flag whether to fail if a field is missing or not.
|
Json |
ignoreParseErrors(boolean ignoreParseErrors)
Sets flag whether to fail when parsing json fails.
|
Json |
jsonSchema(String jsonSchema)
Deprecated.
Json supports derive schema from table schema by default, it is no longer
necessary to explicitly declare the format schema. This method will be removed in the
future. |
Json |
schema(TypeInformation<Row> schemaType)
Deprecated.
Json supports derive schema from table schema by default, it is no longer
necessary to explicitly declare the format schema. This method will be removed in the
future. |
protected Map<String,String> |
toFormatProperties()
Converts this descriptor into a set of format properties.
|
toProperties
toString
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 ignoreParseErrors(boolean ignoreParseErrors)
ignoreParseErrors
- If set to true, the operation will ignore parse errors. If set to
false, the operation fails when parsing json fails.@Deprecated public Json jsonSchema(String jsonSchema)
Json
supports derive schema from table schema by default, it is no longer
necessary to explicitly declare the format schema. This method will be removed in the
future.The schema might be nested.
jsonSchema
- JSON schema@Deprecated public Json schema(TypeInformation<Row> schemaType)
Json
supports derive schema from table schema by default, it is no longer
necessary to explicitly declare the format schema. This method will be removed in the
future.JSON objects are represented as ROW types.
The schema might be nested.
schemaType
- type information that describes the schema@Deprecated public Json deriveSchema()
This allows for defining schema information only once.
The names, types, and fields' 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.
protected Map<String,String> toFormatProperties()
FormatDescriptor
FormatDescriptorValidator.FORMAT
.toFormatProperties
in class FormatDescriptor
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.