public class JsonRowDeserializationSchema extends Object implements org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row>
Deserializes a byte[] message as a JSON object and reads the specified fields.
Failures during deserialization are forwarded as wrapped IOExceptions. TODO: - Should we return a Row in name based mode? - Should we infer the RowKind automatically? https://phabricator.wikimedia.org/T310082
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonRowDeserializationSchema.Builder
Builder for
JsonRowDeserializationSchema. |
static class |
JsonRowDeserializationSchema.RowFieldMode
Used to determine which of the Row field modes in which this deserializer should create Rows.
|
| Modifier | Constructor and Description |
|---|---|
protected |
JsonRowDeserializationSchema(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo,
boolean failOnMissingField,
boolean ignoreParseErrors)
Default constructor that will deserialize Rows in hybrid POSITION_WITH_NAMES mode.
|
protected |
JsonRowDeserializationSchema(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo,
boolean failOnMissingField,
boolean ignoreParseErrors,
JsonRowDeserializationSchema.RowFieldMode rowFieldMode) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.types.Row |
convert(com.fasterxml.jackson.databind.JsonNode root)
Convert a JsonNode to a Row following this schema.
|
org.apache.flink.types.Row |
deserialize(byte[] message) |
boolean |
equals(Object o) |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
getProducedType() |
int |
hashCode() |
boolean |
isEndOfStream(org.apache.flink.types.Row nextElement) |
protected JsonRowDeserializationSchema(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo,
boolean failOnMissingField,
boolean ignoreParseErrors,
JsonRowDeserializationSchema.RowFieldMode rowFieldMode)
protected JsonRowDeserializationSchema(org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> typeInfo,
boolean failOnMissingField,
boolean ignoreParseErrors)
public org.apache.flink.types.Row deserialize(byte[] message)
throws IOException
deserialize in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row>IOExceptionpublic org.apache.flink.types.Row convert(com.fasterxml.jackson.databind.JsonNode root)
public boolean isEndOfStream(org.apache.flink.types.Row nextElement)
isEndOfStream in interface org.apache.flink.api.common.serialization.DeserializationSchema<org.apache.flink.types.Row>public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getProducedType()
getProducedType in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.types.Row>Copyright © 2025. All rights reserved.