Repository navigation
Parquet / Arrow: fix FID desync and post-filtering across skipped row groups (fixes #15119) - #15120
bhuvan-somisetty wants to merge 2 commits into
Conversation
… groups (fixes OSGeo#15119) When reading a Parquet dataset without an explicit FID column (m_iFIDArrowColumn < 0) where row groups have been skipped, slice RecordBatch instances at remapping jump boundaries so each batch is guaranteed to have contiguous sequential dataset row indices. This ensures BASE_SEQUENTIAL_FID passed to OGRFilterArrowArray correctly aligns with the true dataset FIDs during post-filtering. Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
|
@bhuvan-somisetty Have AI tools been used to generate this PR ? Did you test locally because I get the following error when running your test locally Furthermore the new test, once fixed with the following, still passes with the unpatched Parquet driver, so it doesn't exercise the modified code you suggest |
…nc fix
The test added FIDs via GetArrowStream() using a non-existent "OGC_FID"
column, since the layer has no explicit FID column and none is exposed
in the fast Arrow read path. It also filtered by "FID >= 10" combined
with a spatial filter, which resolves entirely at row-group selection
time and ends up selecting a single contiguous row group, never
exercising the batch-splitting logic.
Add a real MY_ID field to check row identity, and use an attribute
filter ("FID <= 12") that only partially matches the row group after
the skipped one, forcing row-level post-filtering with the
BASE_SEQUENTIAL_FID value that the fix corrects. Verified this test
fails without the fix (wrongly keeps FIDs 13/14) and passes with it.
Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
|
No AI-generated PR — sorry about the broken test, that was on me for not running it locally before pushing. Fixed now:
I built GDAL locally with Arrow/Parquet and confirmed the new test fails on the unpatched driver (wrongly keeps FIDs 13/14) and passes with the fix. Also ran the full Pushed the update, ready for another look whenever you get a chance. |
so, you've tried to fix a complex issue, wrote a test that was semi working but never tried to run it before submitting the PR... no human I know works like that. Hard to believe you, especially when looking at your github activity. |
|
for reference our AI tool policy: https://gdal.org/en/stable/community/ai_tool_policy.html |
What does this PR do?
In
OGRParquetLayer, when reading a dataset without an explicit FID column (m_iFIDArrowColumn < 0) where row groups are skipped, this PR ensures that ArrowRecordBatchinstances are sliced at remapping jump boundaries (m_asFeatureIdxRemapping).This guarantees that every emitted batch has contiguous sequential dataset row indices, ensuring
BASE_SEQUENTIAL_FIDpassed toOGRFilterArrowArrayduring post-filtering remains consistent with the true dataset row FIDs across all batches.What are related issues/pull requests?
Fixes #15119
Tasklist
Signed-off-by: bhuvan-somisetty somisettybhuvan5@gmail.com