Reputation: 93
I want to sink my filtered data into a single json file,but got several parts in an output directory. Here is my code:
String sinkSql =
"create TEMPORARY table FileSink(" +
"name STRING," +
"timestamps BIGINT," +
"temp DOUBLE" +
") WITH(" +
"'connector'='filesystem'," +
"'path'='E:\\output'," +
"'format' ='json')";
tableEnvironment.executeSql(sinkSql);
filter.executeInsert("FileSink");
Upvotes: 0
Views: 888
Reputation: 43612
I don't believe there's a simple way to do this.
But what you could do is
stream.writeAsText("/path/to/file")
to produce the outputFlink 1.15 will add more JSON support in the table API. Perhaps with that release it will become possible to do this using the PrintSink -- not sure.
Upvotes: 1