You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ja...@apache.org on 2026/08/19 17:14:08 UTC

(sedona-db) branch main updated: feat(rust/sedona-functions): add the Sedona Spark ST_Force3DZ alias for st_force3d (#1162)

This is an automated email from the ASF dual-hosted git repository.

james-willis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git


The following commit(s) were added to refs/heads/main by this push:
     new f34050154 feat(rust/sedona-functions): add the Sedona Spark ST_Force3DZ alias for st_force3d (#1162)
f34050154 is described below

commit f3405015432dc5afa24adb1816862a3ccf50bc92
Author: James Willis <ja...@users.noreply.github.com>
AuthorDate: Wed Aug 19 10:14:02 2026 -0700

    feat(rust/sedona-functions): add the Sedona Spark ST_Force3DZ alias for st_force3d (#1162)
---
 docs/reference/sql/st_force3d.qmd         | 2 ++
 rust/sedona-functions/src/st_force_dim.rs | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/docs/reference/sql/st_force3d.qmd b/docs/reference/sql/st_force3d.qmd
index 297c4059f..c09cdfb8b 100644
--- a/docs/reference/sql/st_force3d.qmd
+++ b/docs/reference/sql/st_force3d.qmd
@@ -39,6 +39,8 @@ kernels:
 
 If the geometry already has Z values they are preserved; otherwise the optional `z` argument (default 0) is used.
 
+Aliases: `ST_Force3DZ`.
+
 ## Examples
 
 ```sql
diff --git a/rust/sedona-functions/src/st_force_dim.rs b/rust/sedona-functions/src/st_force_dim.rs
index ebedfeb70..626726180 100644
--- a/rust/sedona-functions/src/st_force_dim.rs
+++ b/rust/sedona-functions/src/st_force_dim.rs
@@ -145,7 +145,7 @@ impl CrsTransform for Force2DTransform {
 
 /// ST_Force3D() scalar UDF
 pub fn st_force3d_udf() -> SedonaScalarUDF {
-    SedonaScalarUDF::new(
+    let udf = SedonaScalarUDF::new(
         "st_force3d",
         ItemCrsKernel::wrap_impl(vec![
             Arc::new(STForce3D {
@@ -154,7 +154,9 @@ pub fn st_force3d_udf() -> SedonaScalarUDF {
             Arc::new(STForce3D { is_geography: true }),
         ]),
         Volatility::Immutable,
-    )
+    );
+    // Sedona Spark registers this function as ST_Force3DZ as well
+    udf.with_aliases(vec!["st_force3dz".to_string()])
 }
 
 #[derive(Debug)]
@@ -441,6 +443,7 @@ mod tests {
 
         let st_force3d: ScalarUDF = st_force3d_udf().into();
         assert_eq!(st_force3d.name(), "st_force3d");
+        assert!(st_force3d.aliases().contains(&"st_force3dz".to_string()));
 
         let st_force3dm: ScalarUDF = st_force3dm_udf().into();
         assert_eq!(st_force3dm.name(), "st_force3dm");