Skip to content

refactor(core): DType.Extension carries an ExtensionId, not a String - #626

Merged
dfa1 merged 3 commits into
mainfrom
refactor/extension-id-typed
Nov 1, 2026
Merged

dfa1 merged 3 commits into
mainfrom
refactor/extension-id-typed

Conversation

@dfa1

@dfa1 dfa1 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Follow-up to #625. DType.Extension#extensionId() returned the raw string, though the reader had already parsed it into an ExtensionId at the file boundary. So most consumers re-parsed it (ExtensionId.parse(ext.extensionId())) or compared strings (ExtensionId.VORTEX_TIMESTAMP.id().equals(...)).

It now returns the typed id, matching ExtensionDecoder/ExtensionEncoder#extensionId():

  • Consumers in calcite, cli, jdbc, parquet, the inspector, the reader and the writer switch on the id or compare it by identity.
  • The reader passes along the id it already parsed.
  • Only the FlatBuffer serializer turns it back into its wire string.

Breaking: build the dtype with ExtensionId.VORTEX_DATE or ExtensionId.parse("acme.money") instead of a string.

Two commits:

  1. Test cleanups for the extension examples:
    • validateVector states the accepted storage shape as one record pattern.
    • Helpers drop parameters that were always given the same value, and fixtures for failing reads close their reader.
    • nullRows_readBackAsNull pins the null rows by id. The comparison against the vector() fixture still passed when the fixture stopped writing nulls; this test now fails.
    • IntelliJ reports no warnings in either test.
  2. The ExtensionId change. About 60 test constructions were rewritten by a reviewed script. Five string assertions were fixed by hand: they compiled but would have failed at run time, since an ExtensionId never equals a String.

./mvnw verify is green locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_011fRbYrNfgxEVYukCoXYfre

dfa1 and others added 3 commits November 1, 2026 15:12
CustomExtensionIntegrationTest: validateVector states the one accepted storage shape as a
record pattern instead of nested negations; the dtype helpers drop parameters always given
the same value; readers opened only to assert a failure are closed; Chunk.column needs no
cast. nullRows_readBackAsNull lists the null rows by id: the existing comparison against the
vector() fixture still passes when the fixture stops writing nulls, so nothing caught it.

CurrencyExtensionIntegrationTest asserts the expected code directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011fRbYrNfgxEVYukCoXYfre
The id was parsed at the file boundary and then stored as its raw string, so most consumers
re-parsed it (ExtensionId.parse(ext.extensionId())) or compared strings
(ExtensionId.VORTEX_TIMESTAMP.id().equals(...)). DType.Extension#extensionId() now returns
the typed id, matching ExtensionDecoder/ExtensionEncoder#extensionId(): consumers switch or
compare by identity on it, the reader passes the id it already parsed, and only the
FlatBuffer serializer turns it back into its wire string. Strings at the boundary, types
inside.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011fRbYrNfgxEVYukCoXYfre
- RaincloudConformanceIntegrationTest compared the wire string with the typed id, which
  compiled and was always false, so timestamp and time columns lost their unit rescaling; it
  compares the ids. CI does not run the raincloud tag, so nothing caught it.
- A null extension id is refused where the dtype is built, now under test.
- The by-id null-row assertion moves into fullScan_decodesEveryVectorAndNull: one file write
  instead of two, and it still fails when the fixture stops writing nulls.
- VortexWriter imports ExtensionId instead of spelling the package out; the reader's test
  helper takes an ExtensionId, so a mistyped id no longer becomes a custom one silently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011fRbYrNfgxEVYukCoXYfre
@dfa1
dfa1 merged commit 93d9c3a into main Nov 1, 2026
7 checks passed
@dfa1
dfa1 deleted the refactor/extension-id-typed branch November 1, 2026 14:52
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