jiayuasu opened a new issue, #3290:
URL: https://github.com/apache/sedona/issues/3290

   ## Expected behavior
   
   A representable STAC search — one bbox, one datetime interval, a named 
collection, no ID or geometry filter — should push `bbox` and `datetime` to the 
Collection's advertised Items endpoint whether or not the caller bounded the 
result set with `max_items`.
   
   ## Actual behavior
   
   `CollectionClient._api_search_options` opens with `max_items is None or 
max_items <= 0 → return None`, so the API-native search path added in #3287 is 
only taken when the caller also supplies a positive `max_items`.
   
   `save_to_geoparquet` is the one public entry point that structurally cannot 
supply `max_items`: it neither accepts nor forwards one, while `search()`, 
`get_items()`, and `get_dataframe()` all expose it. Its queries always fall 
into the uncapped fallback, which sets a 200-Item page size but never 
`__stacApiSearchBbox`/`__stacApiSearchDatetime`. The reader then enumerates the 
collection and `_apply_spatial_temporal_filters` discards the non-matching 
Items in Spark afterwards.
   
   Additionally, `StacBatch` guards the client API search branch with 
`require(needCountNextItems, "Client API search options require a positive 
itemsLimitMax")`, so the datasource rejects an uncapped search during scan 
planning even if the client emits one.
   
   `max_items` is a result cap, not a precondition for search — the two 
conditions are independent.
   
   ## Steps to reproduce the problem
   
   ```python
   client = Client.open("https://earth-search.aws.element84.com/v1";)
   collection = client.get_collection("sentinel-2-c1-l2a")
   collection.save_to_geoparquet(
       output_path="/tmp/out",
       bbox=[[-114.0, -31.0, -108.0, 37.0]],
       datetime=[["2025-01-01T00:00:00Z", "2025-02-01T00:00:00Z"]],
   )
   ```
   
   This enumerates every global Item in the window (paged, with client-side 
Spark filtering) instead of issuing one bbox+datetime-constrained Items 
request. Measured against the live Element84 API: the export runs for tens of 
minutes; with the pushdown it completes in seconds (1,753 matching Items).
   
   ## Settings
   
   Sedona version = master (after #3287)
   API type = Python


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