cetra3 commented on PR #26282:
URL: https://github.com/apache/datafusion/pull/26282#issuecomment-7149115870

   *Claude on behalf of @cetra3*
   
   @adriangb I tried this against Vortex to see how it holds up.
   
   I pointed `vortex-datafusion` (develop) at this branch. It compiles with no 
source changes and the existing tests pass. Out of the box it gets no benefit: 
Vortex converts `get_field` natively, and for anything it can't convert it 
falls back to reading the referenced columns whole, so it never consults the 
trait.
   
   I then wrote a small consumer (~230 lines) in that fallback path. It calls 
`required_fields` for each function in the leftover projection and narrows the 
scan to those paths. With a test UDF that reads `s.a` and `s.b.x` out of a 
wider struct:
   
   | 50k rows, 8.6 MB file | bytes read |
   |---|---:|
   | capability off | 8,614,764 |
   | capability declared | 1,816,852 |
   
   Results are identical, including null structs. So for struct-shaped data the 
split works the way I'd hoped: the trait only describes the expression side 
(which paths a call reads), and each source decides how to act on that. Nothing 
in the trait is Parquet specific; the leaf mapping and stats lookup all live in 
`datasource-parquet`.
   
   Where you're right is variant. Vortex's variant is an opaque dtype with 
shredding hidden inside the encoding, so there are no `typed_value.*` paths for 
`required_fields` to name. There Vortex would convert `variant_get` to its own 
native expression and skip the trait entirely, which I think is fine: the trait 
is an opt-in for sources that expose nested layout as Arrow struct fields, not 
a requirement.
   
   One thing I didn't test is `output_statistics` on the Vortex side, since UDF 
filters aren't pushed into the Vortex scan.
   
   I've also merged up to main. The only real conflict was with #27259 (map 
lookups below a struct field), which I've moved into `get_field`'s 
implementation of the capability.
   
   Happy to push the Vortex prototype somewhere if it's useful to look at.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to