How to save RDD data into json files, not folders

后端 未结 3 1054
挽巷
挽巷 2020-12-07 04:46

I am receiving the streaming data myDStream (DStream[String]) that I want to save in S3 (basically, for this question, it doesn\'t matter where exa

3条回答
  •  無奈伤痛
    2020-12-07 05:37

    AFAIK there is no option to save it as a file. Because it's a distributed processing framework and it's not a good practice write on single file rather than each partition writes it's own files in the specified path.

    We can pass only output directory where we wanted to save the data. OutputWriter will create file(s)(depends on partitions) inside specified path with part- file name prefix.

提交回复
热议问题