Skip to content

rdump to avro fails for basic use #228

Description

@jeffbryner

flow.record.version 3.21

Attempting a basic export to avro

uv run target-query /path/to/file.E01 -f users -q | uv run rdump -vvv -w users.avro

fails with

2026-05-13T15:56:35.967729Z [error    ] rdump encountered a fatal error: Unsupported Avro type: path [flow.record.tools.rdump]
2026-05-13T15:56:35.967790Z [error    ] Full traceback                 [flow.record.tools.rdump]
Traceback (most recent call last):
  File "/Users/jeffbryner/development/test/.venv/lib/python3.12/site-packages/flow/record/tools/rdump.py", line 419, in main
    record_writer.write(rec)
  File "/Users/jeffbryner/development/test/.venv/lib/python3.12/site-packages/flow/record/adapter/avro.py", line 72, in write
    self.schema = descriptor_to_schema(self.desc)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffbryner/development/test/.venv/lib/python3.12/site-packages/flow/record/adapter/avro.py", line 159, in descriptor_to_schema
    raise ValueError(f"Unsupported Avro type: {field_type}")

Or

uv run target-query /path/to/file.E01 -f users -q | uv run rdump -vvv -w avro://users.avro

fails with:

Traceback (most recent call last):
  File "/Users/jeffbryner/development/test/.venv/lib/python3.12/site-packages/flow/record/tools/rdump.py", line 419, in main
    record_writer.write(rec)
  File "/Users/jeffbryner/development/testvil_hackathon/.venv/lib/python3.12/site-packages/flow/record/adapter/avro.py", line 72, in write
    self.schema = descriptor_to_schema(self.desc)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffbryner/development/test/.venv/lib/python3.12/site-packages/flow/record/adapter/avro.py", line 159, in descriptor_to_schema
    raise ValueError(f"Unsupported Avro type: {field_type}")
ValueError: Unsupported Avro type: path

Other export formats work fine including jsonl, duckdb, etc

Activity

  1. jeffbryner commented on May 13, 2026

    @jeffbryner
    Author

    FWIW: Analysis by cline,

    Overview

    The failure occurs because the avro adapter in the flow-record library (.venv/lib/python3.12/site-packages/flow/record/adapter/avro.py) lacks a mapping for the path field type to an Avro primitive type. When rdump tries to serialize the output of the users query, it encounters the home field, which is explicitly typed as a path, and throws an error.

    Unlike SQLite and DuckDB adapters that default unknown types to TEXT, the Avro adapter performs a strict lookup. We can fix this by adding "path": "string" (and its system-specific variants) to the AVRO_TYPE_MAP dictionary directly within the virtual environment's package.

    Key Changes

    • .venv/lib/python3.12/site-packages/flow/record/adapter/avro.py: Update the AVRO_TYPE_MAP dictionary to map path, posix_path, and windows_path to Avro's "string" type.

    Not sure this would work though, appears that it would happen with any unknown field type encountered?

  2. yunzheng commented on May 17, 2026

    @yunzheng
    Member

    This is indeed due to a missed mapping in the AVRO adapter. Is this something you want to try and fix yourself? I'll be happy to review it.

  3. added theissue type on May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions