Class MaxwellJsonDeserializationSchema

  • 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>

    public class MaxwellJsonDeserializationSchema
    extends Object
    implements org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
    Deserialization schema from Maxwell JSON to Flink Table/SQL internal data structure RowData. The deserialization schema knows Maxwell's schema definition and can extract the database data and convert into RowData with RowKind.

    Deserializes a byte[] message as a JSON object and reads the specified fields.

    Failures during deserialization are forwarded as wrapped IOExceptions.

    See Also:
    Maxwell, Serialized Form
    • Nested Class Summary

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

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

      Constructors 
      Constructor Description
      MaxwellJsonDeserializationSchema​(org.apache.flink.table.types.DataType physicalDataType, List<org.apache.flink.formats.json.maxwell.MaxwellJsonDecodingFormat.ReadableMetadata> requestedMetadata, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo, boolean ignoreParseErrors, org.apache.flink.formats.common.TimestampFormat timestampFormat)  
    • Constructor Detail

      • MaxwellJsonDeserializationSchema

        public MaxwellJsonDeserializationSchema​(org.apache.flink.table.types.DataType physicalDataType,
                                                List<org.apache.flink.formats.json.maxwell.MaxwellJsonDecodingFormat.ReadableMetadata> requestedMetadata,
                                                org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> producedTypeInfo,
                                                boolean ignoreParseErrors,
                                                org.apache.flink.formats.common.TimestampFormat timestampFormat)
    • Method Detail

      • 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
      • deserialize

        public org.apache.flink.table.data.RowData deserialize​(byte[] message)
                                                        throws IOException
        Specified by:
        deserialize in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
        Throws:
        IOException
      • deserialize

        public void deserialize​(byte[] message,
                                org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
                         throws IOException
        Specified by:
        deserialize in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.table.data.RowData>
        Throws:
        IOException
      • 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>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object