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属性填写错误,修改后执行成功
本文介绍在使用NIFI进行数据处理时遇到的CSVReader配置错误,具体表现为ValueSeparator属性设置不当导致的ArrayIndexOutOfBoundsException异常。通过检查源码,定位到问题所在并给出解决方案。
8万+

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



