Skip to content

Push try_variant_get into the Vortex scan - #11853

Open
robert3005 wants to merge 1 commit into
rk/variant-get-conversionfrom
rk/datafusion-try-variant-get
Open

robert3005 wants to merge 1 commit into
rk/variant-get-conversionfrom
rk/datafusion-try-variant-get

Conversation

@robert3005

@robert3005 robert3005 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #11850.

DataFusion evaluated try_variant_get of datafusion-variant above the scan, so the scan materialized the whole Variant even for a path stored in a shredded column. try_variant_get returns null for a missing path or a value that does not convert, as Vortex's variant_get does, so the typed form over a $-rooted path of plain object fields now converts to variant_get in the scan. The strict variant_get raises on failed casts and stays in DataFusion. The function is matched by name, because it is not part of DataFusion.

It is stacked on #11850 because the results match try_variant_get only once variant_get converts values as Arrow does. Before that, a shredded value of another type than the requested one, such as a Variant integer requested as VARCHAR, would come back null. #11851 adds the speed-up for Variants stored as separate columns.

🤖 Generated with Claude Code

@robert3005 robert3005 added the changelog/performance A performance improvement label Nov 23, 2026

@lwwmanning lwwmanning left a comment

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.

Posted by Claude Opus 5.5 on Will's behalf.

The conversion is small and conservative: it requires a literal $.field path of plain names and a Variant input, and the strict variant_get stays in DataFusion. The tests cover the paths it rejects. One question inline about the claim that it is correct without #11850.

if return_dtype.is_variant() {
return Err(Unconverted::Unsupported);
}
Ok(variant_get(input, path, Some(return_dtype)))

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.

The description says this is correct on its own, because try_variant_get and Vortex's variant_get both return null for a value that does not convert. But #11850 says that on develop, Vortex's variant_get does not yet convert as Arrow does. A typed value of another type than the requested one falls back to core storage, which does not hold it. datafusion-variant converts through Arrow, so before #11850 this pushdown can return null where try_variant_get returns a converted value: for example, a Variant integer requested as VARCHAR from a shredded column. If that is right, please stack this PR on #11850, or say in the description that the results match only once #11850 lands.

try_variant_get of datafusion-variant returns null for a missing path or a value that does not convert, as Vortex's variant_get does, so it converts to variant_get for a $-rooted path of plain object fields. The scan then reads a shredded path from its typed column instead of materializing the whole Variant. The strict variant_get stays in DataFusion.

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 force-pushed the rk/datafusion-try-variant-get branch from 5410b1c to d82eff3 Compare November 23, 2026 16:38
@robert3005
robert3005 changed the base branch from develop to rk/variant-get-conversion November 23, 2026 16:38

@lwwmanning lwwmanning left a comment

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.

Posted by Claude Opus 5.5 on Will's behalf.

Resolved: the PR is now stacked on #11850 with the same commit, and the description explains why. No further findings.

@codspeed

codspeed Bot commented Nov 23, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 10.09%

1 warning

⚠️ 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 improved benchmark
✅ 2029 untouched benchmarks
⏩ 136 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Walltime decode_avx512[DeltaU8] 11.1 µs 10.1 µs +10.09%

Tip

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


Comparing rk/datafusion-try-variant-get (d82eff3) with rk/variant-get-conversion (c302195)

Open in CodSpeed

Footnotes

  1. 136 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. ↩

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

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants