问题
I am generating CSV outputs from tuples. I can't find a way of generating headers in the files. Could anyone confirm whether this is possible or not?
回答1:
it might be possible, but I haven't found it. I added a flatmap function upstream that (a) converted the output POJO to a string, and (b) did a one-shot injection of the header row. But there are concerns with state recovery, to ensure it always and only gets written out once.
来源:https://stackoverflow.com/questions/54463386/generate-csv-files-with-headers