Class AbstractJsonDeserializationSchema

java.lang.Object
org.apache.flink.formats.json.AbstractJsonDeserializationSchema
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>, org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>
Direct Known Subclasses:
JsonParserRowDataDeserializationSchema, JsonRowDataDeserializationSchema

public abstract class AbstractJsonDeserializationSchema extends Object implements org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
Deserialization schema from JSON to Flink Table/SQL internal data structure RowData. This is the abstract base class which has different implementation.

Failures during deserialization are forwarded as wrapped IOExceptions.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema

    org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
    Flag indicating whether to fail if a field is missing.
    protected final boolean
    Flag indicating whether to ignore invalid fields/rows (default: throw an exception).
    protected org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper
    Object mapper for parsing the JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractJsonDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> resultTypeInfo, boolean failOnMissingField, boolean ignoreParseErrors, org.apache.flink.formats.common.TimestampFormat timestampFormat)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData>
     
    int
     
    boolean
    isEndOfStream(org.apache.flink.table.data.RowData nextElement)
     
    void
    open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.flink.api.common.serialization.DeserializationSchema

    deserialize, deserialize
  • Field Details

    • failOnMissingField

      protected final boolean failOnMissingField
      Flag indicating whether to fail if a field is missing.
    • ignoreParseErrors

      protected final boolean ignoreParseErrors
      Flag indicating whether to ignore invalid fields/rows (default: throw an exception).
    • objectMapper

      protected transient org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper objectMapper
      Object mapper for parsing the JSON.
  • Constructor Details

    • AbstractJsonDeserializationSchema

      public AbstractJsonDeserializationSchema(org.apache.flink.table.types.logical.RowType rowType, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> resultTypeInfo, boolean failOnMissingField, boolean ignoreParseErrors, org.apache.flink.formats.common.TimestampFormat timestampFormat)
  • Method Details

    • open

      public void open(org.apache.flink.api.common.serialization.DeserializationSchema.InitializationContext context) throws Exception
      Specified by:
      open in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
      Throws:
      Exception
    • isEndOfStream

      public boolean isEndOfStream(org.apache.flink.table.data.RowData nextElement)
      Specified by:
      isEndOfStream in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
    • getProducedType

      public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> getProducedType()
      Specified by:
      getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.table.data.RowData>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object