diff --git a/metalus-core/src/main/scala/com/acxiom/pipeline/PipelineStepMapper.scala b/metalus-core/src/main/scala/com/acxiom/pipeline/PipelineStepMapper.scala index 6d38e9f0..965a1951 100644 --- a/metalus-core/src/main/scala/com/acxiom/pipeline/PipelineStepMapper.scala +++ b/metalus-core/src/main/scala/com/acxiom/pipeline/PipelineStepMapper.scala @@ -3,7 +3,6 @@ package com.acxiom.pipeline import com.acxiom.pipeline.utils.{DriverUtils, ReflectionUtils, ScalaScriptEngine} import org.apache.log4j.Logger import org.json4s.Formats -import org.json4s.native.JsonMethods.parse import org.json4s.native.Serialization import scala.annotation.tailrec @@ -515,9 +514,7 @@ trait PipelineStepMapper { private def mapByValue(value: Option[String], parameter: Parameter, pipelineContext: PipelineContext): Any = { implicit val formats: Formats = pipelineContext.getJson4sFormats - if (value.getOrElse("").startsWith("[") || value.getOrElse("").startsWith("{")) { - parse(value.get).values // option 1: using the first byte of the string - } else if (value.isDefined) { + if (value.isDefined) { value.get } else if (parameter.defaultValue.isDefined) { logger.debug(s"Parameter ${parameter.name.get} has a defaultValue of ${parameter.defaultValue.getOrElse("")}") diff --git a/metalus-core/src/test/scala/com/acxiom/pipeline/PipelineStepMapperTests.scala b/metalus-core/src/test/scala/com/acxiom/pipeline/PipelineStepMapperTests.scala index 5dea21a6..7b21d0c4 100644 --- a/metalus-core/src/test/scala/com/acxiom/pipeline/PipelineStepMapperTests.scala +++ b/metalus-core/src/test/scala/com/acxiom/pipeline/PipelineStepMapperTests.scala @@ -1,7 +1,5 @@ package com.acxiom.pipeline -import java.io.File - import com.acxiom.pipeline.audits.{AuditType, ExecutionAudit} import com.acxiom.pipeline.utils.DriverUtils import org.apache.commons.io.FileUtils @@ -11,6 +9,8 @@ import org.apache.spark.sql.SparkSession import org.json4s.{DefaultFormats, Formats} import org.scalatest.{BeforeAndAfterAll, FunSpec, GivenWhenThen, Suite} +import java.io.File + class PipelineStepMapperTests extends FunSpec with BeforeAndAfterAll with GivenWhenThen with Suite { private val FIVE = 5 override def beforeAll() { @@ -113,8 +113,6 @@ class PipelineStepMapperTests extends FunSpec with BeforeAndAfterAll with GivenW ("big int", Parameter(value = Some(BigInt("5")), `type` = Some("integer")), BigInt("5")), ("decimal", Parameter(value = Some(BigInt("5")), `type` = Some("integer")), BigInt("5")), ("list", Parameter(value = Some(List("5")), `type` = Some("integer")), List("5")), - ("string list", Parameter(value = Some("[\"a\", \"b\", \"c\" \"d\"]"), `type` = Some("list")), List("a", "b", "c", "d")), - ("int list", Parameter(value = Some("[1, 2, 3]"), `type` = Some("list")), List(1, 2, 3)), ("default value", Parameter(name = Some("fred"), defaultValue = Some("default value"), `type` = Some("string")), "default value"), ("string from global", Parameter(value = Some("!globalString"), `type` = Some("string")), "globalValue1"), ("GlobalLink overrides root global", Parameter(value = Some("!link9"), `type` = Some("string")), "link_override"),