Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6423550
feat(sedona-raster): AsyncByteLoader trait + OutDbLoaderRegistry
james-willis May 27, 2026
a75126e
feat(sedona-expr): needs_bytes annotation on SedonaScalarUDF
james-willis May 27, 2026
ae65d5f
feat(sedona): RS_EnsureLoaded async UDF + register_outdb_loader API
james-willis May 27, 2026
b4c7338
feat(sedona): analyzer rule wraps needs_bytes UDFs with RS_EnsureLoaded
james-willis May 27, 2026
3f0b27c
feat(sedona-raster-gdal): GdalLoader implementing AsyncByteLoader
james-willis May 27, 2026
d7fce30
feat(sedona-raster-zarr): ZarrLoader implementing AsyncByteLoader
james-willis May 27, 2026
57e910d
chore: review revisions
james-willis May 28, 2026
d616992
feat(sedona-raster-gdal): block-aligned cancellable loop + byte cap
james-willis May 28, 2026
05fb09f
refactor(raster): host OutDb loader registry on ConfigOptions
james-willis May 29, 2026
4ec95e9
fix(raster): preserve raster extension in RS_EnsureLoaded output + De…
james-willis Jun 1, 2026
da6b533
refactor(raster): move RS_EnsureLoaded wrapping to a logical optimize…
james-willis Jun 1, 2026
486864b
refactor(raster): move RsEnsureLoaded to sedona-raster-functions; gen…
james-willis Jun 1, 2026
b856b49
docs(raster): link issue #897 from the view round-trip gap sites
james-willis Jun 1, 2026
b2de837
refactor(raster): derive Debug for OutDbLoaderRegistry
james-willis Jun 1, 2026
05a247d
fix(sedona-query-planner): commit the ensure_loaded.rs that the modul…
james-willis Jun 1, 2026
9abb8d5
revert(c/sedona-extension): drop the SedonaCScalarKernel metadata FFI…
james-willis Jun 1, 2026
9bdf464
Merge remote-tracking branch 'origin/main' into jw/outdb-loader-v2
james-willis Jun 2, 2026
9a2d1f1
refactor(raster): use sedona_internal_err!/plan_err! instead of Err(.…
james-willis Jun 2, 2026
7fdebc4
refactor(raster): trim RS_EnsureLoaded boilerplate; set ideal async b…
james-willis Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 41 additions & 4 deletions rust/sedona-expr/src/scalar_udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ pub struct SedonaScalarUDF {
signature: Signature,
kernels: Vec<ScalarKernelRef>,
aliases: Vec<String>,
/// Class-level metadata: does this UDF read raster pixel bytes from
/// any of its inputs? The optimiser/analyzer rule for `RS_EnsureLoaded`
/// uses this to decide whether to wrap raster arguments. Default
/// `false`; set via [`SedonaScalarUDF::with_needs_bytes`] at
/// construction time for UDFs whose kernels call
/// `BandRef::nd_buffer()` / `BandRef::contiguous_data()`.
needs_bytes: bool,
Comment thread
james-willis marked this conversation as resolved.
Outdated
}

impl PartialEq for SedonaScalarUDF {
Expand Down Expand Up @@ -191,19 +198,31 @@ impl SedonaScalarUDF {
signature,
kernels,
aliases: vec![],
needs_bytes: false,
}
}

/// Add aliases to an existing SedonaScalarUDF
pub fn with_aliases(self, aliases: Vec<String>) -> SedonaScalarUDF {
Self { aliases, ..self }
}

/// Mark this UDF as one whose kernels read raster pixel bytes from
/// their inputs. The optimiser/analyzer rule for `RS_EnsureLoaded`
/// reads this to decide whether to wrap raster arguments with the
/// async byte-materialisation UDF.
pub fn with_needs_bytes(self) -> SedonaScalarUDF {
Self {
name: self.name,
signature: self.signature,
kernels: self.kernels,
aliases,
needs_bytes: true,
..self
}
}

/// Returns whether this UDF reads raster pixel bytes from its inputs.
pub fn needs_bytes(&self) -> bool {
self.needs_bytes
}

/// Create a SedonaScalarUDF from a single kernel
///
/// This constructor creates a [Volatility::Immutable] function with no documentation
Expand Down Expand Up @@ -334,6 +353,24 @@ mod tests {

use super::*;

#[test]
fn needs_bytes_defaults_false_and_flips_via_builder() {
let udf = SedonaScalarUDF::new("u", vec![], Volatility::Immutable);
assert!(!udf.needs_bytes());

let annotated = udf.with_needs_bytes();
assert!(annotated.needs_bytes());
}

#[test]
fn needs_bytes_survives_with_aliases() {
let udf = SedonaScalarUDF::new("u", vec![], Volatility::Immutable)
.with_needs_bytes()
.with_aliases(vec!["u_alias".to_string()]);
assert!(udf.needs_bytes());
assert_eq!(udf.aliases(), &["u_alias".to_string()]);
}

#[test]
fn udf_empty() -> Result<()> {
// UDF with no implementations
Expand Down
5 changes: 4 additions & 1 deletion rust/sedona-raster-gdal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ result_large_err = "allow"
[dependencies]
arrow-array = { workspace = true }
arrow-buffer = { workspace = true }
arrow-schema = { workspace = true }
async-trait = { workspace = true }
datafusion-common = { workspace = true }
lru = { workspace = true }
sedona-common = { workspace = true }
sedona-gdal = { workspace = true }
sedona-raster = { workspace = true }
sedona-schema = { workspace = true }
tokio = { workspace = true }

[dev-dependencies]
criterion = { workspace = true }
sedona-gdal = { workspace = true, features = ["gdal-sys"] }
sedona-testing = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
2 changes: 1 addition & 1 deletion rust/sedona-raster-gdal/src/gdal_dataset_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl GDALDatasetCache {
})
}

fn get_or_create_outdb_source(
pub(crate) fn get_or_create_outdb_source(
&self,
gdal: &Gdal,
path: &str,
Expand Down
6 changes: 3 additions & 3 deletions rust/sedona-raster-gdal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ mod gdal_common;
#[allow(dead_code)]
mod gdal_dataset_provider;

mod utils;

#[cfg(test)]
mod outdb_loader;
mod source_uri;
mod utils;

// Re-export main dataset conversion functions
pub use gdal_common::{
band_data_type_to_gdal, bytes_to_f64, gdal_to_band_data_type, gdal_type_byte_size,
nodata_bytes_to_f64, nodata_f64_to_bytes,
};
pub use outdb_loader::{GdalLoader, GDAL_FORMAT};
pub use utils::{append_as_indb_raster, dataset_to_indb_raster};
Loading
Loading