From 53c176c2490aa8e4d0d6710edf29df5f1ab61aaf Mon Sep 17 00:00:00 2001 From: James Willis Date: Thu, 16 Jan 2025 21:40:21 -0800 Subject: [PATCH] [SEDONA-697] Make getGeometryColumnName a public function (#1760) Co-authored-by: jameswillis --- .../src/main/scala/org/apache/sedona/stats/Weighting.scala | 2 +- .../scala/org/apache/sedona/stats/clustering/DBSCAN.scala | 2 +- .../sedona/stats/outlierDetection/LocalOutlierFactor.scala | 2 +- .../apache/sedona/{stats/Util.scala => util/DfUtils.scala} | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename spark/common/src/main/scala/org/apache/sedona/{stats/Util.scala => util/DfUtils.scala} (96%) diff --git a/spark/common/src/main/scala/org/apache/sedona/stats/Weighting.scala b/spark/common/src/main/scala/org/apache/sedona/stats/Weighting.scala index 1b252cc432..41869817e0 100644 --- a/spark/common/src/main/scala/org/apache/sedona/stats/Weighting.scala +++ b/spark/common/src/main/scala/org/apache/sedona/stats/Weighting.scala @@ -18,7 +18,7 @@ */ package org.apache.sedona.stats -import org.apache.sedona.stats.Util.getGeometryColumnName +import org.apache.sedona.util.DfUtils.getGeometryColumnName import org.apache.spark.sql.functions._ import org.apache.spark.sql.sedona_sql.expressions.st_functions.{ST_Distance, ST_DistanceSpheroid} import org.apache.spark.sql.{Column, DataFrame} diff --git a/spark/common/src/main/scala/org/apache/sedona/stats/clustering/DBSCAN.scala b/spark/common/src/main/scala/org/apache/sedona/stats/clustering/DBSCAN.scala index 96a4e8c317..11bdb8306e 100644 --- a/spark/common/src/main/scala/org/apache/sedona/stats/clustering/DBSCAN.scala +++ b/spark/common/src/main/scala/org/apache/sedona/stats/clustering/DBSCAN.scala @@ -18,7 +18,7 @@ */ package org.apache.sedona.stats.clustering -import org.apache.sedona.stats.Util.getGeometryColumnName +import org.apache.sedona.util.DfUtils.getGeometryColumnName import org.apache.spark.sql.functions._ import org.apache.spark.sql.sedona_sql.UDT.GeometryUDT import org.apache.spark.sql.sedona_sql.expressions.st_functions.{ST_Distance, ST_DistanceSpheroid} diff --git a/spark/common/src/main/scala/org/apache/sedona/stats/outlierDetection/LocalOutlierFactor.scala b/spark/common/src/main/scala/org/apache/sedona/stats/outlierDetection/LocalOutlierFactor.scala index 1d2689917d..55e682d079 100644 --- a/spark/common/src/main/scala/org/apache/sedona/stats/outlierDetection/LocalOutlierFactor.scala +++ b/spark/common/src/main/scala/org/apache/sedona/stats/outlierDetection/LocalOutlierFactor.scala @@ -18,7 +18,7 @@ */ package org.apache.sedona.stats.outlierDetection -import org.apache.sedona.stats.Util.getGeometryColumnName +import org.apache.sedona.util.DfUtils.getGeometryColumnName import org.apache.spark.sql.sedona_sql.expressions.st_functions.{ST_Distance, ST_DistanceSphere} import org.apache.spark.sql.{Column, DataFrame, SparkSession, functions => f} diff --git a/spark/common/src/main/scala/org/apache/sedona/stats/Util.scala b/spark/common/src/main/scala/org/apache/sedona/util/DfUtils.scala similarity index 96% rename from spark/common/src/main/scala/org/apache/sedona/stats/Util.scala rename to spark/common/src/main/scala/org/apache/sedona/util/DfUtils.scala index cdfe5fca23..18d4bc0c1a 100644 --- a/spark/common/src/main/scala/org/apache/sedona/stats/Util.scala +++ b/spark/common/src/main/scala/org/apache/sedona/util/DfUtils.scala @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.sedona.stats +package org.apache.sedona.util import org.apache.spark.sql.DataFrame import org.apache.spark.sql.sedona_sql.UDT.GeometryUDT -private[stats] object Util { +object DfUtils { def getGeometryColumnName(dataframe: DataFrame): String = { val geomFields = dataframe.schema.fields.filter(_.dataType == GeometryUDT)