Skip to content

File Output

The file_output node will save an incoming dataset to a file inside a specific folder.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
    type: file_output
    component : output
    settings: {
        // the output format you want
        // csv, json, com.databricks.spark.csv
        format: csv


        // Location of the output file.
        folder_path: ./folder

        // dataset repartitioning
        number_of_repartition: 1

        // Overwrite, Append, AppendIfExists , Ignore or Overwrite
        // Check https://spark.apache.org/docs/2.4.0/api/java/org/apache/spark/sql/SaveMode.html
        save_mode: overwrite
    }
    subscribe: [
        {
            component: input
            stream: data
        }
    ]
}