qlong commented on code in PR #15384:
URL: https://github.com/apache/iceberg/pull/15384#discussion_r3132703073
##########
api/src/main/java/org/apache/iceberg/expressions/PathUtil.java:
##########
@@ -27,60 +27,255 @@
import java.util.stream.Collectors;
import
org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
-import org.apache.iceberg.relocated.com.google.common.base.Splitter;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.relocated.com.google.common.collect.Streams;
public class PathUtil {
private PathUtil() {}
+ /**
+ * One step in a variant JSONPath: an object member name or a zero-based
array index (RFC 9535
+ * {@code [n]} selector).
+ */
+ sealed interface PathSegment permits PathSegment.Name, PathSegment.Index {
+ record Name(String name) implements PathSegment {}
+
+ record Index(int index) implements PathSegment {}
+ }
+
private static final String RFC9535_NAME_FIRST =
"[A-Za-z_\\x{0080}-\\x{D7FF}\\x{E000}-\\x{10FFFF}]";
private static final String RFC9535_NAME_CHARS =
"[0-9A-Za-z_\\x{0080}-\\x{D7FF}\\x{E000}-\\x{10FFFF}]*";
private static final Predicate<String> RFC9535_MEMBER_NAME_SHORTHAND =
Pattern.compile(RFC9535_NAME_FIRST +
RFC9535_NAME_CHARS).asMatchPredicate();
+ /** Letters that follow {@code \} for control-character escapes in RFC 9535
quoted segments. */
+ private static final String RFC9535_SIMPLE_ESCAPE_LETTERS = "btnfr";
+
+ private static final String RFC9535_SIMPLE_ESCAPE_CHARS = "\b\t\n\f\r";
Review Comment:
IMHO Json spec is double edged, it is both developer friendly and unfriendly
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]