From b7f856daa81776e9c2e551b7ad357386763a5572 Mon Sep 17 00:00:00 2001 From: "milos.colic" Date: Tue, 17 Oct 2023 13:52:10 +0100 Subject: [PATCH] Fix merge conflicts. --- .../databricks/labs/mosaic/core/raster/api/RasterAPI.scala | 2 -- .../labs/mosaic/core/raster/io/RasterCleaner.scala | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala index 63b85e6a7..e82dcb11d 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/api/RasterAPI.scala @@ -4,8 +4,6 @@ import com.databricks.labs.mosaic.core.raster._ import com.databricks.labs.mosaic.core.raster.gdal.MosaicRasterGDAL import com.databricks.labs.mosaic.core.raster.io.{RasterCleaner, RasterReader} import com.databricks.labs.mosaic.core.raster.operator.transform.RasterTransform -import com.databricks.labs.mosaic.utils.PathUtils -import com.databricks.labs.mosaic.core.raster.gdal_raster.{MosaicRasterGDAL, RasterCleaner, RasterReader, RasterTransform} import org.apache.spark.sql.types.{BinaryType, DataType, StringType} import org.apache.spark.unsafe.types.UTF8String diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala index d40f35261..12f090fe6 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/io/RasterCleaner.scala @@ -27,6 +27,8 @@ object RasterCleaner { ds.FlushCache() // Not to be confused with physical deletion, this is just deletes jvm object ds.delete() + } catch { + case _: Any => () } } } @@ -37,11 +39,15 @@ object RasterCleaner { try { r.destroy() r.cleanUp() + } catch { + case _: Any => () } case rt: MosaicRasterTile => try { rt.raster.destroy() rt.raster.cleanUp() + } catch { + case _: Any => () } // NOOP for simpler code handling in expressions, removes need for repeated if/else case _ => ()