NIFI使用过程中报错,查看源码发现越界后会报此错误
public String get(final String name) {
if (mapping == null) {
throw new IllegalStateException(
"No header mapping was specified, the record values can't be accessed by name");
}
final Integer index = mapping.get(name);
if (index == null) {
throw new IllegalArgumentException(String.format("Mapping for %s not found, expected one of %s", name,
mapping.keySet()));
}
try {
return values[index.intValue()];
} catch (final ArrayIndexOutOfBoundsException e) {
throw new IllegalArgumentException(String.format(
"Index for header '%s' is %d but CSVRecord only has %d values!", name, index,
Integer.valueOf(values.length)));
}
}
继续检查发现配置CSVReader时Value Separator属性填写错误,修改后执行成功