-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrow API returns empty stream when one of ignored fields is used in attribute filter #9655
Comments
This is the expected result.
I don't confirm this with the following snippet that returns nothing when SetIgnoredFields() is called, and returns one record otherwise
Running the above snippet on a Parquet file will even trigger an error:
In #9664, I'm clarifying the interaction between SetAttributeFilter() and SetIgnoredFields() |
Thanks @rouault for investigating and the additional clarification in the docs; that helps explain existing behavior when using the Arrow API. And your test refuting my results was very helpful because it identified a bug in pyogrio causing us to not actually set the ignored fields when we were reading in regular (non-Arrow API) mode. |
@rouault I suppose it is non-trivial to either support filtering on ignored fields or to always throw an error when there is a risk for wrong data being returned, i.e. when OGRSQL is used? As it involves wrong data being returned, an error would be even better than documentation I suppose... |
It's a bit tricky. It cannot be really done by SetAttributeFilter() or SetIgnoredFields() themselves, otherwise that means that there should be a precise ordering of them. So if that was done, that should be done later when starting to evaluate the filter |
What is the bug?
First observed in pyogrio #388
When using the Arrow API, if an ignored field is used by the attribute filter, an empty stream will be returned. When the ignored field is not used by the attribute field, the correct results are returned.
When not using the Arrow API, the correct results are returned.
Steps to reproduce the issue
Using NaturalEarth lowres shapefile
Versions and provenance
Detected in GDAL 3.8.3 - 3.8.5
Additional context
No response
The text was updated successfully, but these errors were encountered: