I have a map:

```
val map = Map("A" -> 1, "B" -> 2)

```

And I have a `DataFrame`. a column in the data frame contains the keys in the map. I am trying to select a column in a new DF that has the map values in it based on the key:

```
val newDF = DfThatContainsTheKeyColumn.select(concat(col(SomeColumn), lit("|"),
    lit(map.get(col(ColumnWithKey).toString()).get) as newColumn)

```

But this is resulting in the following error:

```
java.lang.RuntimeException: Unsupported literal type class scala.None$ None

```

I made sure that the column ColumnWithKey has `A`s and `B`s only and does not have empty values in it.

Is there another way to get the result I am looking for? Any help would be appreciated.