【发布时间】:2021-03-10 18:10:37
【问题描述】:
我正在使用 Apache.Avro 1.10.1,并尝试在运行时生成架构。
在解析模式时出现,某些信息被丢弃。在下面的简单示例中,字段“something”有一个logicalType 集。但是,在将解析后的模式转换回字符串时,缺少此信息。
static void Main(string[] args)
{
const string txt = @"
{
""type"": ""record"",
""namespace"": ""test"",
""name"": ""Type1"",
""fields"": [
{
""name"": ""something"",
""type"": ""int"",
""logicalType"": ""date""
}
]
}
";
var schema = Avro.Schema.Parse(txt);
var str = schema.ToString();
// str has the following value, i.e. is missing logicalType:
// {"type":"record","name":"Type1","namespace":"test","fields":[{"name":"something","type":"int"}]}
}
}
以前有人遇到过这种情况吗?
我不完全确定这是我的使用错误,还是库本身的错误。
【问题讨论】: