Skip to content

Support a load_errors sink in the (relations ...) CSV loading form - #272

Open
hbarthels wants to merge 1 commit into
mainfrom
hb-relations-load-errors
Open

Support a load_errors sink in the (relations ...) CSV loading form#272
hbarthels wants to merge 1 commit into
mainfrom
hb-relations-load-errors

Conversation

@hbarthels

@hbarthels hbarthels commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional trailing (load_errors :name) clause to the generalized (relations ...) CSV loading form, naming the relation that collects rows which fail to load:

(relations
  (keys
    (column "id" INT))
  (relation :wide
    (column "label" STRING)
    (column "ratio" FLOAT))
  (load_errors :my_load_errors))

The load-errors relation has a loader-determined schema that differs from the declared keys and the per-relation value columns. Making it its own clause — rather than another (relation ...) — keeps that difference explicit at the syntax level.

Changes

  • Spec: optional RelationId load_errors = 5 on TargetRelations. Presence-tracked, so "no sink" is distinct from a default-valued one. Additive — buf breaking against main is clean.
  • Grammar: new load_errors nonterminal, optional trailing element of target_relations. Accepted after both plain targets and CDC insert/delete deltas. No grammar conflicts — the generator's multi-token lookahead distinguishes ("relation from ("load_errors.
  • SDKs: regenerated protobuf bindings, parsers, and pretty printers for Python, Julia, and Go.
  • Julia equality: extends TargetRelations ==/isequal/hash to cover load_errors (on top of the synthetic_key fix in Include synthetic_key in TargetRelations equality and hashing #271).

Tests

  • Two round-trip fixtures — relations_load_errors and relations_load_errors_cdc (the latter also exercising (keys synthetic)) — with .bin, pretty, and pretty-debug snapshots.
  • Python parser tests: plain case, CDC case, absence leaving the field unset, and rejection of the clause appearing before the target relations.
  • Julia equality tests for the new field.

Full suite green: meta 817, Python 855, Julia 174 test items, Go ok.

Note on diff size

Most of the line count is regenerated parser/printer output across the three SDKs — same shape as #269. The hand-written changes are confined to proto/relationalai/lqp/v1/logic.proto, meta/src/meta/grammar.y, the Julia equality files, and the tests.

🤖 Generated with Claude Code

@hbarthels
hbarthels force-pushed the hb-relations-load-errors branch from 3077016 to 880c191 Compare July 27, 2026 16:03
Base automatically changed from hb-fix-target-relations-equality to main July 27, 2026 16:36
Add an optional trailing `(load_errors :name)` clause to the generalized
`(relations ...)` loading form, naming the relation that collects rows which
fail to load:

    (relations
      (keys (column "id" INT))
      (relation :wide
        (column "label" STRING)
        (column "ratio" FLOAT))
      (load_errors :my_load_errors))

The load-errors relation has a loader-determined schema that differs from the
declared keys and per-relation value columns, so it is called out as its own
clause rather than being another target relation.

Backed by a presence-tracked `optional RelationId load_errors` on
`TargetRelations`, so an absent sink is distinct from a default-valued one.
The clause is accepted after both plain targets and CDC insert/delete deltas.

Regenerates the protobuf bindings, parsers, and pretty printers for all three
SDKs, and extends the Julia equality/hashing for `TargetRelations` to cover
the new field.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hbarthels
hbarthels force-pushed the hb-relations-load-errors branch from 880c191 to 6bc1804 Compare July 28, 2026 13:38
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