@PublicEvolving public class JsonRowSerializationSchema extends Object implements SerializationSchema<Row>
Serializes the input Flink object into a JSON string and
converts it into byte[]
.
Result byte[]
messages can be deserialized using JsonRowDeserializationSchema
.
Constructor and Description |
---|
JsonRowSerializationSchema(String jsonSchema)
Creates a JSON serialization schema for the given JSON schema.
|
JsonRowSerializationSchema(TypeInformation<Row> typeInfo)
Creates a JSON serialization schema for the given type information.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
serialize(Row row)
Serializes the incoming element to a specified type.
|
public JsonRowSerializationSchema(TypeInformation<Row> typeInfo)
typeInfo
- The field names of Row
are used to map to JSON properties.public JsonRowSerializationSchema(String jsonSchema)
jsonSchema
- JSON schema describing the result typepublic byte[] serialize(Row row)
SerializationSchema
serialize
in interface SerializationSchema<Row>
row
- The incoming element to be serializedCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.