jiayuasu commented on code in PR #2890:
URL: https://github.com/apache/sedona/pull/2890#discussion_r3176223797


##########
spark/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala:
##########
@@ -278,6 +278,7 @@ object Catalog extends AbstractCatalog with Logging {
   // Bounding-Box-Functions
   val boundingBoxExprs: Seq[FunctionDescription] = Seq(
     function[ST_BoundingDiagonal](),
+    function[ST_Box2D](),

Review Comment:
   Scala DataFrame API wrappers (st_functions.*) for the Box2D Phase 1 surface 
are deliberately deferred and tracked in #2891. Doing them in one coherent 
batch after the SQL functions land reads cleaner than wrapping each in 
isolation.



##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/InferredExpression.scala:
##########
@@ -266,6 +269,12 @@ object InferredTypes {
       } else {
         null
       }
+    } else if (t =:= typeOf[Box2D]) { output =>
+      if (output != null) {
+        Box2DUDT().serialize(output.asInstanceOf[Box2D])
+      } else {
+        null
+      }

Review Comment:
   Done in 8674e2f. Replaced `Box2DUDT()` (which calls `apply()` and allocates) 
with the case object `Box2DUDT` (singleton), captured once outside the closure.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to