Skip to content

fix: read event-keyed warehouse history on Snowflake and report metadata read errors - #1504

Open
kvlonge wants to merge 1 commit into
mainfrom
fix/metadata-read-errors
Open

kvlonge wants to merge 1 commit into
mainfrom
fix/metadata-read-errors

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Why

On Snowflake, warehouse history sync failed for the five event kinds whose columns already include event_id. The read appended event_id to a projection and ordering that already had it, and Snowflake rejects the query with "ambiguous column name 'EVENT_ID'". DuckDB and SQLite accept the duplicate, so local tests passed. The location also discarded the error and printed only "Warehouse metadata read failed. No page delivered." with no reason.

Changes

  • History reads select and order by event_id once. The cursor keeps its fixed length per kind (the trailing event ID repeats a key and is not used for ordering), so the read protocol is unchanged.
  • The event ID of each record and the cursor's event-ID value come from the selected event_id column when the kind already has one.
  • Failed metadata reads and warehouse connections now print the event kind, the error class and the driver message (with named secrets and URI passwords redacted) in the location's output. Reader start, exchange and timeout failures on the CLI side are printed too.
  • The bindings crate's code-line cap rises by 16 lines, to its new size, for the error reporting.

Verification

  • New unit test: for every event kind and every adapter dialect, each column is selected once and each key ordered once. It fails on the old code with the exact duplicated SQL.
  • The existing DuckDB and SQLite state-event tests page every kind across a page boundary with real cursors.
  • New integration test: an unopenable warehouse reports the driver error. The catalog boundary test now checks the reported reason.
  • Read-only reads on a Snowflake trial account of all nine event kinds, 40-row pages across page boundaries: 0.231.0 fails five kinds on the first page; this branch reads all 104 distinct rows of each.

DuckShop: no new case. Its existing edge-case fixtures for these kinds already cover the table shape, and the rejection only occurs on Snowflake.

…ata read errors

History reads appended event_id to projections and orderings that already
contained it, which Snowflake rejects as an ambiguous column. Select and order
by it once, keeping each kind's fixed-length cursor. Failed metadata reads and
warehouse connections now report the kind and the redacted driver error.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant