Hi Lasse,
If the datastream job is used, you can try setting `OutputFileConfig`
for file sink, something like[1]:
```
OutputFileConfig config = OutputFileConfig
.builder()
.withPartPrefix("prefix")
.withPartSuffix(".ext")
.build();
FileSink<Tuple2<Integer, Integer>> sink = FileSink
.forRowFormat((new Path(outputPath), new SimpleStringEncoder<>("UTF-8"))
.withBucketAssigner(new KeyBucketAssigner())
.withRollingPolicy(OnCheckpointRollingPolicy.build())
.withOutputFileConfig(config)
.build();
```
[1]
https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/connectors/datastream/filesystem/#bucket-assignment
Lasse Nedergaard <[email protected]> 于2024年3月20日周三 20:50写道:
>
> Hi.
>
> Anyone know if it’s possible to control the file names eg change the uuid
> file names and extensions to something else. I know I can control the path
> but I would like to be able to set the file name and the extension based on
> the data in the stream. So I can’t use any general pre or postfix that are
> applied to all files.
>
> All ideas appreciate
>
> Med venlig hilsen / Best regards
> Lasse Nedergaard
>
--
Best,
Yanfei