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 119682321 [SEDONA-611] Fix writing rasters to S3 on EMR (#1482)
119682321 is described below

commit 119682321f5301e6ef776315a8f2cd53a8ff63b0
Author: Kristin Cowalcijk <[email protected]>
AuthorDate: Fri Jun 21 08:26:08 2024 +0800

    [SEDONA-611] Fix writing rasters to S3 on EMR (#1482)
---
 .../apache/spark/sql/sedona_sql/io/raster/RasterFileFormat.scala    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/io/raster/RasterFileFormat.scala
 
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/io/raster/RasterFileFormat.scala
index 14bce862f..d47594ea3 100644
--- 
a/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/io/raster/RasterFileFormat.scala
+++ 
b/spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/io/raster/RasterFileFormat.scala
@@ -85,7 +85,7 @@ private class RasterFileWriter(
     context: TaskAttemptContext)
     extends OutputWriter {
 
-  private val hfs = FileSystem.newInstance(new Path(savePath).toUri, 
context.getConfiguration)
+  private val hfs = (new 
Path(savePath)).getFileSystem(context.getConfiguration)
   private val rasterFieldIndex =
     if (rasterOptions.rasterField.isEmpty) getRasterFieldIndex
     else dataSchema.fieldIndex(rasterOptions.rasterField.get)
@@ -119,9 +119,7 @@ private class RasterFileWriter(
     }
   }
 
-  override def close(): Unit = {
-    hfs.close()
-  }
+  override def close(): Unit = {}
 
   def path(): String = {
     savePath

Reply via email to