You can convert map into the dataframe as follows :
import org.apache.spark.sql.types._
import org.apache.spark.sql.functions._
val input : Map[String,String] = Map("com.project.name" -> "A", "com.project.age" -> "23")
val df = input.tail
.foldLeft(Seq(input.head._2).toDF(input.head._1))((acc,curr) =>
acc.withColumn(curr._1,lit(curr._2)))
Now if you want to get the Row from the Dataframe you can get as follows :
val row = df.first
And if you want to see the names of the column you can get that as follows :
val columns = df.columns