How do I write dataframe to file system directly (not hdfs) as text format?


#1

I know it is easy to write dataframe to hdfs, however, how do I write it to file system which allows me to ls, cat, view?

[paslechoix@gw03 ~]$ hdfs dfs -ls top5_customers_per_month
Found 2 items
-rw-r–r-- 3 paslechoix hdfs 0 2018-03-13 23:55 top5_customers_per_month/_SUCCESS
-rw-r–r-- 3 paslechoix hdfs 114 2018-03-13 23:55 top5_customers_per_month/part-00000
[paslechoix@gw03 ~]$ hdfs dfs -cat top5_customers_per_month/*
[2014-03,10351,4489.65]
[2013-08,9515,4229.84]
[2014-01,7,4139.68]
[2014-06,12284,4139.33]
[2014-04,2564,4069.84]

I want something like:
cat result.txt
[2014-03,10351,4489.65]
[2013-08,9515,4229.84]
[2014-01,7,4139.68]
[2014-06,12284,4139.33]
[2014-04,2564,4069.84]

Thanks.