You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "james-willis (via GitHub)" <gi...@apache.org> on 2026/05/05 19:21:13 UTC
Re: [PR] feat: N-dimensional raster type extension (Phase 1) [sedona-db]
james-willis commented on code in PR #749:
URL: https://github.com/apache/sedona-db/pull/749#discussion_r3190986130
##########
rust/sedona-raster-functions/src/rs_band_accessors.rs:
##########
@@ -120,14 +120,15 @@ fn get_pixel_type(
Ok(())
}
Some(raster) => {
- let num_bands = raster.bands().len();
+ let num_bands = raster.num_bands();
if band_index < 1 || band_index > num_bands as i32 {
builder.append_null();
return Ok(());
}
- let band = raster.bands().band(band_index as usize)?;
- let dt = band.metadata().data_type()?;
- builder.append_value(dt.pixel_type_name());
+ match raster.band_data_type((band_index - 1) as usize) {
+ Some(dt) => builder.append_value(dt.pixel_type_name()),
+ None => builder.append_null(),
Review Comment:
not totally sure if we should handle this branch or throw. _should_ generally be unreachable - we don't expect the arrow to contain datatype values that don't exist.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org