[英]Avro append a record with non-existent schema and save as an avro file?
I have just started using Avro and I'm using fastavro library in Python.我刚刚开始使用 Avro,我正在 Python 中使用 fastavro 库。
Thanks in advance.提前致谢。
Avro files, by definition, already have a schema within them.根据定义,Avro 文件中已经有一个模式。
You could read that schema first, then continue to append data, or you can read entire file into memory, then append your data, then overwrite the file.您可以先读取该架构,然后继续读取 append 数据,或者您可以将整个文件读取到 memory,然后读取 append 数据,然后覆盖文件。
Each option require you to convert the JSON into Avro (or at least a Python dict), though.不过,每个选项都要求您将 JSON 转换为 Avro(或至少 Python 字典)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.