在flink中针对读取csv文件的输出可以有3种格式,都是通过引用inputFormat来控制的,分别为 PojoCsvInputFormat输出类型为pojo, RowCsvInputFormat输出类型为Row, TupleCsvInputFormat输出类型为Tuple。本例子就用RowCsvInputFormat。
可以进入到RowCsvInputFormat 看看其构造函数都有哪些
public RowCsvInputFormat(
Path filePath,
TypeInformation[] fieldTypeInfos,
String lineDelimiter,
String fieldDelimiter,
int[] selectedFields,
boolean emptyColumnAsNull) {
super(filePath);
this.arity = fieldTypeInfos.length;
if (arity != selectedFields.length) {
throw new IllegalArgumentException("Number of field types and selected fields must be the same");
}
this.fieldTypeInfos = fieldTypeInfos;
this.fieldPosMap = toFieldPosMap(selectedFields);
this.emptyColumnAsNull = emptyColumnAsNull;
boolean[] fieldsMask

最低0.47元/天 解锁文章
2852

被折叠的 条评论
为什么被折叠?



