简体   繁体   English

Scala Spark将字符串写入文件

[英]Scala Spark write string to file

我正在使用一个Spark集群,我想将一个字符串写入文件并使用Scala将其保存到主节点中,我查看了本主题并尝试了一些建议,但是找不到保存的文件

You would just need to call collect on the RDD to bring the collection back to the driver. 您只需要在RDD上调用collect即可将集合返回给驱动程序。 Then you can write it to the file system on the driver. 然后,您可以将其写入驱动程序上的文件系统。

Although it would be recommended to write it in a parallelized fashion for performance. 尽管建议以并行方式编写它以提高性能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM