I would like to retrieve column value from Spark SQL query result. But
currently it seems that Spark SQL only support retrieving by index


val results = sqlContext.sql("SELECT name FROM people")
results.map(t => "Name: " + *t(0)*).collect().foreach(println)

I think it will be much more convenient if I could do something like this:

results.map(t => "Name: " + *t("name")*).collect().foreach(println)

How do you like?



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Should-Spark-SQL-support-retrieve-column-value-from-Row-by-column-name-tp22174.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to