james-willis opened a new pull request, #1219:
URL: https://github.com/apache/sedona-db/pull/1219

   **Stacked on #1211 → #1218.** Every head lives on the fork, so this PR is 
based on `main` and its diff includes the lower layers' commits until they 
merge (the resample module itself is `test(integration): RS_Resample parity...` 
and the bbox-anchor follow-up). Merge #1211 and #1218 first.
   
   The next step of the parity roadmap from #1203/#1212: RS_Resample, probed 
first on both engines, then locked in with anchored `compare()` calls where 
agreement holds and `xfail`-cataloged where it doesn't. RS_MapAlgebra is out of 
scope (SedonaDB doesn't implement it; the roadmap docstring is updated 
accordingly).
   
   ### What agrees (13 passing tests, all anchored)
   
   The nearest-neighbour path is bit-for-bit identical across every overload:
   
   - **Dimension mode**: 2x upsample (uint8 and float64-with-nodata), identity, 
non-integer-ratio downsample, integer SQL literals, lowercase algorithm 
spelling.
   - **Scale mode**: exact tiling, and the grown-extent case — 
`ceil(extent/pixel)` output, border filled with band nodata *or 0 when absent* 
(both engines share the 0-fill convention).
   - **Reference-raster overload** (4-arg, via CROSS JOIN) and the **grid-snap 
overload** (7-arg) with centres strictly inside the source.
   - Both engines refuse zero width / zero scale (parity on refusal, per-engine 
`pytest.raises`).
   
   Nearest resampling on the seeded grid is hand-computable (block replication 
up, centre-rule decimation down), so every passing test states its exact 
expected `DecodedRaster` — no vacuous agreement.
   
   ### What diverges (12 xfails)
   
   - **Positive scaleY**: SedonaDB keeps the origin at the top edge and grids 
upward off the raster; Spark rebases to the bottom edge and covers the source 
south-up.
   - **Bilinear** (uint8 + float64) and **Bicubic**: both engines really 
interpolate, but GDAL and JAI kernels differ (edge clamping vs nodata/zero 
fill, integer rounding).
   - **Silent fallback family** (Cubic, CubicSpline, Lanczos, Average, Mode): 
Sedona Spark only implements NearestNeighbor/Bilinear/Bicubic and silently 
resamples nearest for every other name — SedonaDB runs the real kernel. Probed 
on a downsample, where Average/Mode can't agree by construction.
   - **Unknown algorithm**: SedonaDB rejects `'sinc'`; Spark silently resamples 
nearest.
   - **Fractional width**: SedonaDB rejects; Spark truncates 3.5 → 3 columns.
   - **Grid-snap edge centres**: output centres landing exactly on the source's 
left edge — GDAL samples the edge pixel, JAI zero-fills.
   
   ### Verification
   
   - Suite: `34 passed, 25 xfailed` locally (pyspark 4.0.4, Sedona 1.9.1) — the 
module adds 13 passed / 12 xfailed to #1212's 21/13, and every xfail was 
probe-confirmed to actually trip.
   - Anchors were verified against both engines' observed output before being 
baked in.
   
   


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