liaoxin01 commented on code in PR #56705:
URL: https://github.com/apache/doris/pull/56705#discussion_r2443994368
##########
fe/fe-core/src/main/java/org/apache/doris/common/util/S3Util.java:
##########
@@ -300,6 +302,92 @@ public static String getLongestPrefix(String globPattern) {
return globPattern.substring(0, earliestSpecialCharIndex);
}
+ // Apply some rules to extend the globs parsing behavior
+ public static String extendGlobs(String pathPattern) {
+ return extendGlobNumberRange(pathPattern);
+ }
+
+ /**
+ * Convert range patterns to brace enumeration patterns for glob matching.
+ * Parts containing negative numbers or non-numeric characters are skipped.
+ * eg(valid):
+ * -> "file{1..3}" => "file{1,2,3}"
+ * -> "file_{1..3,4,5..6}" => "file_{1,2,3,4,5,6}"
+ * eg(invalid)
+ * -> "data_{-1..4}.csv" will not load any file
+ * -> "data_{a..4}.csv" will not load any file
+ * @param pathPattern Path that may contain {start..end} or mixed
{start..end,values} patterns
+ * @return Path with ranges converted to comma-separated enumeration
+ */
+ public static String extendGlobNumberRange(String pathPattern) {
Review Comment:
Please add a UT.
--
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]