Kontinuation opened a new pull request, #740:
URL: https://github.com/apache/sedona-db/pull/740

   ## Summary
   This PR fixes the failing 
`vector::layer::tests::test_layer_iteration_and_reset` test in `sedona-gdal` 
for GDAL 3.10+.
   
   ## Root Cause
   The test failure is rooted in a change introduced in **GDAL 3.10.0** 
(specifically commit 
[f7224b4c60f7](https://github.com/OSGeo/gdal/commit/f7224b4c60f74fc9076f37141b65ec71f8a4102f)).
   
   ### GDAL 3.8 Behavior (Passes)
   *   **Metadata Initialization:** New layers were initialized in 
`gpkg_ogr_contents` with `feature_count = NULL`.
   *   **Reader Behavior:** A separate reader connection encountered `NULL` and 
defaulted to an actual `SELECT COUNT(*)` on the features table, accurately 
reporting the committed features even if the writer was still open.
   
   ### GDAL 3.10+ Behavior (Fails)
   *   **Metadata Initialization:** New layers are now initialized with 
`feature_count = 0`.
   *   **Reader Behavior:** GDAL 3.10+ optimizations cause it to trust 
non-negative metadata values. Because the writer's implicit transaction hadn't 
been flushed or committed, the reader connection saw the stale `0` value and 
returned it immediately without querying the actual data.
   
   ## Implementation
   By explicitly `drop(dataset)`ing the writer before opening the reader, we 
trigger `GDALClose`, which commits all features and accurately updates the 
`gpkg_ogr_contents` metadata to 3. This approach ensures consistent test 
results across all GDAL versions by respecting transactional visibility.
   
   Detailed investigation findings have been added to 
`prompts/gdal_gpkg_investigation.md`.


-- 
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]

Reply via email to