-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
flix-tech/avro-php
#15Labels
bugSomething isn't workingSomething isn't working
Description
Code snipped below doesn't work.
$dataWriter->append(...); seems to not process default value.
Isn't it expected to contain "married" field with "null" value in encoded string? It throws AvroIOTypeException instead
$schema = <<<_JSON
{
"name":"member",
"type":"record",
"fields":[
{"name": "member_id", "type": "int"},
{"name": "member_name", "type": "string"},
{"name": "married", "type": ["null","boolean"], "default": null}
]
}
_JSON;
$jose = [
'member_id' => 1392,
'member_name' => 'Jose',
// 'married' => true
];
$writerSchema = AvroSchema::parse($schema);
$io = new AvroStringIO();
$writer = new AvroIODatumWriter($writerSchema);
$dataWriter = new AvroDataIOWriter($io, $writer, $writerSchema);
$dataWriter->append($jose);
$dataWriter->close();
echo $binaryString = $io->string();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working