Skip to content

R2 storage doesn't include bloom filter or custom metadata #20

Description

@oritwoen

When writing to R2 via DuckDB's COPY, the parquet file skips all custom metadata that local storage includes:

  • bloom filter (fast rejection for full-hash queries)
  • source content hashes (dedup with `--force`)
  • algorithm/source/record-count metadata (fast `info` without scanning)

This means R2-stored databases:

  • always do a full scan for queries that could be rejected instantly
  • can't detect already-processed sources
  • `shaha info --r2` has to scan every row for stats instead of reading metadata

The root cause is that DuckDB's `COPY ... TO` writes its own parquet, while local storage uses ArrowWriter where we can inject key-value metadata. Fixing this likely means writing to a temp local parquet first (with all metadata), then uploading to R2 — or finding a way to set parquet KV metadata through DuckDB.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions