我有一个这样的avro模式,其中我捕获了以boolean表示的十进制值,我想为它提供默认值true,所以我想出了以下avro模式。
{ "namespace": "abc", "type": "record", "name": "Request", "fields": [ { "name": "amount", "type": "long", }, { "name": "currency", "type": ["string", "null"], }, { "name": "capture", "type": "boolean", "default": true } }
在Java中使用时,它将获得默认值
null
我需要怎么做才能将其默认设置为true
?
我有一个这样的avro模式,其中我捕获了以boolean表示的十进制值,我想将默认值设置为true,因此我提出了以下avro模式。 {“ namespace”:“ abc”,“ ...
这不仅与Java有关。一般而言(根据https://avro.apache.org/docs/current/spec.html中提供的文档),我们有: