Skip to content

Compare nested extension types by storage in Vortex ID exports - #11351

Merged
connortsui20 merged 1 commit into
developfrom
ct/arrow-ext-storage-layout
Nov 9, 2026
Merged

connortsui20 merged 1 commit into
developfrom
ct/arrow-ext-storage-layout

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

Follow-up to #11301, which checks that the Arrow type of a field that names a Vortex ID imports as the storage of the array. That import can lose information about nested extension types: the UUID plugin imports every arrow.uuid field without a version, and a session that does not know a nested Vortex ID imports it as plain storage. So since #11301, some valid exports fail. For example, an extension type whose storage is a struct with a Uuid(v4) field can no longer export to its own to_arrow_storage_field, which worked before.

Changes

The check now compares nested extension types by their storage types, and keeps the exact comparison at the top level. Nested fields keep their checks, because the exporter checks each nested field when it reaches it, and the temporal executor still rejects a time unit that does not match.

The alternative was to require every import plugin to give back exactly the type that it exported. ArrowImportVTable does not require that today, and a plugin for a canonical Arrow type such as arrow.uuid has no standard place for Vortex-only metadata such as the UUID version. Exact round trips for the plugins that Vortex owns are still worth having, but as a separate goal with its own property tests, not as an assumption of this check.

This PR also does the comment pass from the review of #11301 on the export dispatch, the map import, and the map test. The map import still runs import plugins for the extension name of the entries field, which from_arrow_datatype ignores. The comment now says so instead of claiming that the two match, and a test relies on those plugins running, so the behavior is unchanged. The metadata check that the import and the export both copied is now one helper. New tests cover the nested case (it fails without the fix), an alias of a Vortex ID, and a plain array that exports to a field that names a Vortex ID.

@codspeed

codspeed Bot commented Nov 9, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.48%

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 1 improved benchmark
✅ 1916 untouched benchmarks
⏩ 47 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ CPU Simulation ArrowExportVTable_to_arrow_field 19.8 µs 17.9 µs +10.48%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/arrow-ext-storage-layout (976d21c) with develop (1c60cac)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment on lines +1227 to +1234
/// Returns whether `lhs` and `rhs` have the same storage layout, which means that they are equal,
/// ignoring nullability, after every nested extension type is replaced by its storage type. The
/// types at the top level are compared as they are.
///
/// An export compares the type that its target imports as with the storage type this way, because
/// an import can lose the metadata of a nested extension type, such as the version of a UUID, or
/// not know its Vortex ID. The export of each nested field checks that field when it reaches it.
fn eq_storage_layout(lhs: &DType, rhs: &DType) -> bool {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should put this somewhere else? maybe not because I can't think of any other code that should know this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can move it once we have another use for it, right now this is very arrow specific

@connortsui20
connortsui20 enabled auto-merge (squash) November 9, 2026 15:53
@connortsui20
connortsui20 merged commit 19ae853 into develop Nov 9, 2026
155 checks passed
@connortsui20
connortsui20 deleted the ct/arrow-ext-storage-layout branch November 9, 2026 15:54
@connortsui20 connortsui20 mentioned this pull request Nov 9, 2026
12 of 49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants