public abstract class AbstractJsonDeserializationSchema extends Object implements DeserializationSchema<RowData>
RowData
. This
is the abstract base class which has different implementation.
Failures during deserialization are forwarded as wrapped IOExceptions.
DeserializationSchema.InitializationContext
Modifier and Type | Field and Description |
---|---|
protected boolean |
failOnMissingField
Flag indicating whether to fail if a field is missing.
|
protected boolean |
ignoreParseErrors
Flag indicating whether to ignore invalid fields/rows (default: throw an exception).
|
protected org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper |
objectMapper
Object mapper for parsing the JSON.
|
Constructor and Description |
---|
AbstractJsonDeserializationSchema(RowType rowType,
TypeInformation<RowData> resultTypeInfo,
boolean failOnMissingField,
boolean ignoreParseErrors,
TimestampFormat timestampFormat) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
TypeInformation<RowData> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
int |
hashCode() |
boolean |
isEndOfStream(RowData nextElement)
Method to decide whether the element signals the end of the stream.
|
void |
open(DeserializationSchema.InitializationContext context)
Initialization method for the schema.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
deserialize, deserialize
protected final boolean failOnMissingField
protected final boolean ignoreParseErrors
protected transient org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper objectMapper
public AbstractJsonDeserializationSchema(RowType rowType, TypeInformation<RowData> resultTypeInfo, boolean failOnMissingField, boolean ignoreParseErrors, TimestampFormat timestampFormat)
public void open(DeserializationSchema.InitializationContext context) throws Exception
DeserializationSchema
DeserializationSchema.deserialize(byte[])
and thus suitable for one time setup work.
The provided DeserializationSchema.InitializationContext
can be used to access additional features such
as e.g. registering user metrics.
open
in interface DeserializationSchema<RowData>
context
- Contextual information that can be used during initialization.Exception
public boolean isEndOfStream(RowData nextElement)
DeserializationSchema
isEndOfStream
in interface DeserializationSchema<RowData>
nextElement
- The element to test for the end-of-stream signal.public TypeInformation<RowData> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<RowData>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.