james-willis commented on code in PR #749: URL: https://github.com/apache/sedona-db/pull/749#discussion_r3127352237
########## rust/sedona-raster/src/outdb_uri.rs: ########## @@ -0,0 +1,133 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/// Parsed components of an outdb_uri. +/// +/// The outdb_uri format is `scheme://path#fragment`, e.g.: +/// - `geotiff://s3://bucket/file.tif#band=1` +/// - `zarr://s3://bucket/store#temperature/0.0.0` +/// +/// The scheme determines which loader to dispatch to. +/// The path is the external resource location (what RS_BandPath returns to users). +/// The fragment encodes loader-specific details (band id, chunk coords, etc.). +/// Each loader defines its own fragment convention. +/// +/// TODO: For formats like Zarr that may need complex metadata (array path, chunk +/// coordinates, byte ranges), a simple key-value fragment may not be sufficient. +/// If this becomes a limitation, consider switching the fragment to a JSON object +/// or making the entire outdb_uri a JSON string for those formats. +#[derive(Debug, PartialEq)] +pub struct OutDbUri<'a> { + /// Loader scheme (e.g., "geotiff", "zarr") + pub scheme: &'a str, + /// External resource path (e.g., "s3://bucket/file.tif") + pub path: &'a str, + /// Loader-specific fragment (e.g., "band=1"), or None if absent + pub fragment: Option<&'a str>, +} Review Comment: > I think that a NULL outdb_uri always means that the bytes are inlined into the BinaryView and a non-NULL outdb_uri means they have to be fetched (copied). I was thinking the opposite: null `data` field indicates you should go fetch data from outdb_uri. This allows us to leave outdb uri populated for cases where we want to have indb representation but give the engine the ability to dump the memory burden of holding the data indb, knowing it can be reconstructed from the uri + format. > The thing that may be useful to prevent future churn is to keep the parameters (band for geotiff, chunk for zarr, offsets/strides for mem) in the same place. Are you saying you want a dedicated `foramt_parameters: Utf8` field? current plan is to put the in the URI fragment (the stuff after the #): `https://website.com/some/dataset?websiteParam=websiteValue#driverParam=driverValue` -- 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]
