Your code looks overly complicated and the relevant parts are missing. If possible please post the complete snippet including the retrieval/type if rows so we get the complete picture and can try to help.
For first simplification you can just convert aMap to Seq[(String, (String, String))] and further map it to flatten the nested tuple into a Seq which you then pass to toDF via var arg expansion.
Val colNames: Seq[String] = aMap.toSeq.map(kv => Seq(kv._1, kv._2._1, kv._2._2))
Depending on the type of aMap this leads to problems as we assume it to be Map[String, (String, String)].