feat(rust/sedona-raster-functions): add RS_BandPixelType, RS_BandNoDataValue UDFs#612
Merged
Kontinuation merged 7 commits intoapache:mainfrom Mar 4, 2026
Merged
Conversation
ef916cd to
abb1540
Compare
abb1540 to
61fcb0c
Compare
paleolimbot
approved these changes
Mar 3, 2026
Member
paleolimbot
left a comment
There was a problem hiding this comment.
Thank you!
This may fail main CI if it doesn't have docs files (also probably a good idea to add them).
| ) -> Result<ColumnarValue> { | ||
| let executor = RasterExecutor::new(arg_types, args); | ||
| let band_index_array = args[1].clone().into_array(executor.num_iterations())?; | ||
| let band_index_array = band_index_array.as_primitive::<Int32Type>(); |
Member
There was a problem hiding this comment.
Probably better to use DataFusion's downcasting here (as_int32_array(), checks the downcast and returns an internal error in debug mode).
Member
Author
There was a problem hiding this comment.
I have found that we need to cast the band index here before calling as_int32_array. I have switched to calling as_int32_array and added the cast.
…DataValue, RS_BandIsNoData Replace local band_data_type_name(), data_type_byte_size(), bytes_to_f64(), and validate_band_index() helpers with shared BandDataType.pixel_type_name(), BandDataType.byte_size(), BandMetadataRef.nodata_value_as_f64(), and raster_utils::validate_band_index() from pr15-raster-utilities.
- Replace as_primitive::<Int32Type>() with datafusion_common::cast::as_int32_array() for checked downcasting of band index arrays - Add .qmd documentation files for RS_BandPixelType and RS_BandNoDataValue
dbcec30 to
f74e6aa
Compare
SQL integer literals are inferred as Int64 by DataFusion, but as_int32_array/as_primitive<Int32Type> require exactly Int32. Add cast_to(&DataType::Int32) before into_array() to handle any integer width, matching the pattern used by other UDFs (rs_worldcoordinate, rs_setsrid, etc.).
paleolimbot
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RS_BandPixelTypeandRS_BandNoDataValueraster UDFs tosedona-raster-functionsnative-raster-functions.rs