Insert into DynamoDB when data has different attributes
val paramsMap = params.iterator.toMap
val item: Item = new Item()
  .withPrimaryKey(Partition_Key_Name, partition_key)
  .withKeyComponent(Sort_Key_Name, sort_key)

paramsMap.map { case (k, v) =&gt; item.withString(k, v) }
table.putItem(item)


can be solved like this in scala