Frends.Avro.Serialize / 2.1.0
Summary
Writes JSON into Avro's binary format against a schema you supply, taking either a single object or an array. The JSON has to agree with the schema, so this doubles as a shape check.
Typical use — handing data to a platform that expects Avro, where the schema is the contract with the consumer
Input parameters for Avro serialization operation.
| Name | Type | Default | Example | Description |
|---|---|---|---|---|
| Json | String |
– |
Single object: { "name": "Jerry", "age": 30, "city": "New York" }
Array of objects: [{ "name": "John", "age": 30 }, { "name": "Jane", "age": 25 }]
|
Input JSON string that can be both single objects and arrays of objects. The JSON data will be serialized according to the provided Avro schema. |
| Schema | String |
– |
{
"type": "record",
"name": "Person",
"fields": [
{ "name": "name", "type": "string" },
{ "name": "age", "type": "int" },
{ "name": "city", "type": "string" }
]
}
|
Avro Schema definition in JSON format that defines the structure of the data to be serialized. Must be a valid Avro schema that matches the structure of the input JSON data. |
| TargetFilePath | String |
– |
Windows: C:\data\output\myfile.avro
Linux/Mac: /home/user/data/myfile.avro
|
Full path to the target file where the serialized Avro data will be stored. The directory must exist and the file must not already exist (unless overwrite is enabled). |