From da10dc5a69c3d9ac470b83ae568d7f48ad1b2066 Mon Sep 17 00:00:00 2001 From: sllynn Date: Wed, 27 Nov 2024 11:43:37 +0000 Subject: [PATCH] fixed issue where KEY=VALUE operator options were dropped --- .../mosaic/core/raster/operator/gdal/OperatorOptions.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/OperatorOptions.scala b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/OperatorOptions.scala index 320e29613..24cd238e2 100644 --- a/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/OperatorOptions.scala +++ b/src/main/scala/com/databricks/labs/mosaic/core/raster/operator/gdal/OperatorOptions.scala @@ -29,6 +29,7 @@ object OperatorOptions { val preservedMultipleFlags = scala.collection.mutable.ListBuffer[String]() val flagRegex = """^-[a-zA-Z]""".r + val keyValueRegex = """^[^=\s]+=[^=\s]+$""".r // Process the arguments var i = 0 @@ -46,6 +47,8 @@ object OperatorOptions { seenFlags(flag) = values.toList } i += values.length // Skip over the values + } else if (keyValueRegex.findFirstIn(flag).isDefined) { + preservedMultipleFlags += flag // Allow duplicates for these } i += 1 // Move to the next flag }