Exports data as an Apache Avro file using the fastavro library.
Generates an Avro schema with all fields typed as "string" and writes records using fastavro.writer. Null values are converted to empty strings. Rows are buffered in memory and the file is written when CloseFile is called.
fastavro (listed in requirements.txt)from ObjDataExportAvro import ObjExportApi
exporter = ObjExportApi()
exporter.OpenFile("/tmp/output.avro")
exporter.WriteHeader(["Name", "Score"])
exporter.WriteData([["Alice", "95"], ["Bob", "82"]])
exporter.CloseFile()
| Method | Description |
|---|---|
OpenFile(filename) |
Set output path and reset row buffer |
WriteHeader(fields) |
Store column names and track redact columns |
WriteData(data) |
Buffer rows (list of lists) with redaction applied |
CloseFile() |
Build Avro schema and write file |
EscapeCSV(val) |
No-op passthrough |
DefaultExtension() |
Returns "avro" |