You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2018/09/20 07:58:58 UTC
[flink] branch master updated: [FLINK-10355] [java] Use 1-based
field indexes in RowCsvInputFormat exception messages.
This is an automated email from the ASF dual-hosted git repository.
fhueske pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new e58cc14 [FLINK-10355] [java] Use 1-based field indexes in RowCsvInputFormat exception messages.
e58cc14 is described below
commit e58cc14db007123c6325c7e51291650da69a4ca2
Author: lihongli <77...@qq.com>
AuthorDate: Tue Sep 18 21:07:20 2018 +0800
[FLINK-10355] [java] Use 1-based field indexes in RowCsvInputFormat exception messages.
This closes #6713.
---
.../src/main/java/org/apache/flink/api/java/io/RowCsvInputFormat.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/io/RowCsvInputFormat.java b/flink-java/src/main/java/org/apache/flink/api/java/io/RowCsvInputFormat.java
index 15ef90e..7a8c553 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/io/RowCsvInputFormat.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/io/RowCsvInputFormat.java
@@ -177,7 +177,7 @@ public class RowCsvInputFormat extends CsvInputFormat<Row> implements ResultType
// the error state EMPTY_COLUMN is ignored
if (parser.getErrorState() != FieldParser.ParseErrorState.EMPTY_COLUMN) {
throw new ParseException(String.format("Parsing error for column %1$s of row '%2$s' originated by %3$s: %4$s.",
- field, new String(bytes, offset, numBytes), parser.getClass().getSimpleName(), parser.getErrorState()));
+ field + 1, new String(bytes, offset, numBytes), parser.getClass().getSimpleName(), parser.getErrorState()));
}
}
holders[fieldPosMap[output]] = parser.getLastResult();
@@ -199,7 +199,7 @@ public class RowCsvInputFormat extends CsvInputFormat<Row> implements ResultType
// check if something went wrong
if (startPos < 0) {
throw new ParseException(String.format("Unexpected parser position for column %1$s of row '%2$s'",
- field, new String(bytes, offset, numBytes)));
+ field + 1, new String(bytes, offset, numBytes)));
}
else if (startPos == limit
&& field != fieldIncluded.length - 1