snuyanzin commented on code in PR #29026:
URL: https://github.com/apache/flink/pull/29026#discussion_r3907540832


##########
flink-core/src/main/java/org/apache/flink/types/variant/BinaryVariantInternalBuilder.java:
##########
@@ -663,4 +735,81 @@ private boolean tryParseDecimal(String input) {
     // Store all keys in `dictionary` in the order of id.
     private final ArrayList<byte[]> dictionaryKeys = new ArrayList<>();
     private final boolean allowDuplicateKeys;
+
+    /** Adapts a shaded Jackson {@link JsonParser} to a {@link 
JsonTokenSource}. */
+    private static final class JacksonJsonTokenSource implements 
JsonTokenSource {
+
+        private final JsonParser parser;
+        private boolean started;
+
+        private JacksonJsonTokenSource(JsonParser parser) {
+            this.parser = parser;
+        }
+
+        @Override
+        public Token next() throws IOException {
+            // The parser may already sit on the value's first token when a 
caller hands it to us
+            // mid-stream. Consume that token before advancing.
+            final JsonToken token;
+            if (!started && parser.currentToken() != null) {
+                token = parser.currentToken();
+            } else {
+                token = parser.nextToken();
+            }
+            started = true;
+            return token == null ? null : toToken(token);
+        }
+
+        @Override
+        public String fieldName() throws IOException {
+            return parser.currentName();
+        }
+
+        @Override
+        public String stringValue() throws IOException {
+            return parser.getText();
+        }
+
+        @Override
+        public String numberText() throws IOException {
+            return parser.getText();
+        }

Review Comment:
   why do we need 2 methods if under the hood nobody checks if it is a number 
or not?



-- 
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]

Reply via email to