You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2023/10/04 15:57:03 UTC

[sedona] branch master updated: [SEDONA-408] Set a reasonable default size for RasterUDT (#1046)

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

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new 556af1681 [SEDONA-408] Set a reasonable default size for RasterUDT (#1046)
556af1681 is described below

commit 556af1681e46146bfbff90a98883b705b761da8e
Author: Kristin Cowalcijk <bo...@wherobots.com>
AuthorDate: Wed Oct 4 23:56:57 2023 +0800

    [SEDONA-408] Set a reasonable default size for RasterUDT (#1046)
---
 .../main/scala/org/apache/spark/sql/sedona_sql/UDT/RasterUDT.scala    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/UDT/RasterUDT.scala b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/UDT/RasterUDT.scala
index af40e761b..7db42c353 100644
--- a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/UDT/RasterUDT.scala
+++ b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/UDT/RasterUDT.scala
@@ -28,6 +28,10 @@ class RasterUDT extends UserDefinedType[GridCoverage2D] {
 
   override def pyUDT: String = "sedona.sql.types.RasterType"
 
+  // A reasonable size for small in-db rasters. This is used by the optimizer to decide whether to
+  // broadcast the dataframe or not.
+  override def defaultSize: Int = 512 * 1024
+
   override def serialize(raster: GridCoverage2D): Array[Byte] = Serde.serialize(raster)
 
   override def deserialize(datum: Any): GridCoverage2D = {