Skip to content

Add a (FIXED N) type for fixed-length byte arrays - #277

Merged
hbarthels merged 2 commits into
mainfrom
hb-fixed-type
Sep 28, 2026
Merged

hbarthels merged 2 commits into
mainfrom
hb-fixed-type

Conversation

@hbarthels

@hbarthels hbarthels commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds (FIXED N), an N-byte array type. It gives LQP a way to declare binary identifiers such as MD5 digests or UUIDs, which are stored as hex in CSV and as fixed[N] in Iceberg:

(relations
  (keys (column "id" (FIXED 16)))
  (relation :node (column "parent" (FIXED 16))))

In CSV data a value is written as 2N hex digits, most significant byte first. That matches Snowflake's MD5 output and its big-endian MD5_NUMBER_UPPER64. The protocol accepts any N. The engine will initially support only (FIXED 16), stored as a UINT128, and reject other lengths when lowering.

  • Spec: FixedType { int32 length } as fixed_type = 15 in the Type oneof. It is additive: buf breaking against main is clean.
  • Grammar: "(" "FIXED" INT ")", following (DECIMAL p s).
  • Julia: ==/isequal/hash for FixedType, and FixedType added to LQPSyntax.
  • Python validator: reports the type as FIXED. Like DECIMAL, the name leaves out the parameter.

Most of the diff is regenerated parser, printer and protobuf code for the three SDKs. The hand-written changes are in logic.proto, grammar.y, the Julia equality files, proto_validator.py, and the fixture.

🤖 Generated with Claude Code

`FixedType { int32 length }` in the `Type` oneof, written `(FIXED N)`. In CSV data a
value is 2N hex digits, most significant byte first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread proto/relationalai/lqp/v1/logic.proto Outdated
Co-authored-by: Nikolas Göbel <nikolas.goebel@relational.ai>
@hbarthels
hbarthels merged commit be92dae into main Sep 28, 2026
5 checks passed
@hbarthels
hbarthels deleted the hb-fixed-type branch September 28, 2026 14:56
hbarthels added a commit that referenced this pull request Sep 28, 2026
Makes the `(FIXED N)` type from #277 available downstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hbarthels added a commit that referenced this pull request Sep 28, 2026
The review suggestion applied in #277 shortened the `FixedType` comment in `logic.proto`
without regenerating, so `logic.pb.go` still carried the old doc comment.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
hbarthels added a commit that referenced this pull request Sep 28, 2026
Makes the `(FIXED N)` type from #277 available downstream.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants