You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Shepherd <Ch...@huawei.com> on 2015/11/02 21:20:43 UTC
Dump table into file
Hi all, I have one table called "result" in the database, for example:
/user/hive/warehouse/data_result.db/result
How do I export the table "result" into a local csv file?
Thanks a lot.
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Dump-table-into-file-tp25252.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org
Re: Dump table into file
Posted by Hitoshi Ozawa <oz...@worksap.co.jp>.
Have you tried using spark-csv?
https://github.com/databricks/spark-csv
e.g.
hiveSQLContext.sql("FROM employee SELECT name, city,
state").write.format("com.databricks.spark.csv").save("employee.csv")
--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Dump-table-into-file-tp25252p25302.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org