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


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/JsonPathReader.java:
##########
@@ -0,0 +1,264 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.runtime.functions;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.core.memory.MemorySegment;
+import org.apache.flink.table.data.StringData;
+import org.apache.flink.table.data.binary.BinaryStringData;
+import org.apache.flink.table.data.binary.StringUtf8Utils;
+import org.apache.flink.table.runtime.functions.SqlJsonUtils.JsonValueContext;
+
+import org.apache.flink.shaded.com.jayway.jsonpath.JsonPath;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonFactory;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonParser;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonToken;
+
+import javax.annotation.Nullable;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.UnaryOperator;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Parses a JSON document like {@link SqlJsonUtils#jsonParse}, but builds only 
what fixed paths
+ * reach: the value at the end of a path in full, and the objects and arrays 
on the way with only
+ * the members the paths need. An array keeps its length, with null for the 
elements no path needs,
+ * so that JsonPath evaluates the paths on the result as on the whole document.
+ *
+ * <p>A document this reader fails on is parsed by {@link 
SqlJsonUtils#jsonParse}, which reports the
+ * failure as before. Jackson's limit on the length of a string applies only 
to the strings this
+ * reader builds.

Review Comment:
   there are options
   for now made it behaving similar to full path
   however in theory 20Mb+ should not be a problem if required field is less 
than that



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