Repository navigation
Push try_variant_get into the Vortex scan - #11853
robert3005 wants to merge 1 commit into
Conversation
lwwmanning
left a comment
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
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>
5410b1c to
d82eff3
Compare
lwwmanning
left a comment
There was a problem hiding this comment.
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.
Merging this PR will improve performance by 10.09%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Stacked on #11850.
DataFusion evaluated
try_variant_getof datafusion-variant above the scan, so the scan materialized the whole Variant even for a path stored in a shredded column.try_variant_getreturns null for a missing path or a value that does not convert, as Vortex'svariant_getdoes, so the typed form over a$-rooted path of plain object fields now converts tovariant_getin the scan. The strictvariant_getraises 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_getonly oncevariant_getconverts values as Arrow does. Before that, a shredded value of another type than the requested one, such as a Variant integer requested asVARCHAR, would come back null. #11851 adds the speed-up for Variants stored as separate columns.🤖 Generated with Claude Code