raminqaf commented on code in PR #29026:
URL: https://github.com/apache/flink/pull/29026#discussion_r3904584231
##########
flink-core/src/main/java/org/apache/flink/types/variant/BinaryVariantInternalBuilder.java:
##########
@@ -548,22 +568,36 @@ public int compareTo(FieldEntry other) {
}
}
- private void buildJson(JsonParser parser) throws IOException {
- JsonToken token = parser.currentToken();
+ /**
+ * Build an IOException enriched with the source's location, mirroring the
location that a
+ * Jackson JsonParseException used to carry before the builder was
decoupled from Jackson.
+ */
+ private static IOException parseError(JsonTokenSource source, String
message) {
+ final String location = source.currentLocation();
+ if (location == null) {
+ return new IOException(message);
+ }
+ return new IOException(message + "\n at " + location);
+ }
Review Comment:
Yes, correct. A structural JSON error carries the token location through
parseError.
You are right about the number path, good catch. I made it consistent. A
malformed number literal now surfaces as a located `IOException`.
The reachability of this exception: Through Jackson this case cannot happen.
Jackson validates number syntax while tokenizing, so 1,5 fails as a structural
error first, already with a location. The raw `NumberFormatException` was
reachable only from a non-Jackson `JsonTokenSource` that reports an invalid
literal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]