github-actions[bot] commented on code in PR #68998:
URL: https://github.com/apache/doris/pull/68998#discussion_r4255125714


##########
fe/fe-filesystem/fe-filesystem-spi/src/main/java/org/apache/doris/filesystem/spi/GlobPattern.java:
##########
@@ -0,0 +1,112 @@
+// 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.doris.filesystem.spi;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/** Numeric-range normalization shared by object storage and Hadoop glob 
listing. */
+public final class GlobPattern {
+    private static final int MAX_EXPANSIONS = 10000;
+    private static final Pattern RANGE = 
Pattern.compile("(-?\\d+)\\.\\.(-?\\d+)");
+    private static final Pattern SIMPLE_RANGE = 
Pattern.compile("\\d+\\.\\.\\d+");
+    private static final Pattern BRACE_GROUP = 
Pattern.compile("\\{([^{}]*)\\}");

Review Comment:
   [P2] Preserve escaped braces inside numeric alternatives
   
   For the valid pattern `data_{1..2,\{special\}}.csv`, this regex cannot match 
the outer group because its content includes the escaped opening brace. It 
matches only `\{special\}`, which the escape check then skips, leaving `1..2` 
unexpanded. `S3CompatibleFileSystem.compileGlobPattern` and `globListWithLimit` 
consequently match literal `data_1..2.csv` instead of `data_1.csv` and 
`data_2.csv`; the previous normalizer expanded this pattern correctly. Parse 
brace boundaries with escape awareness so literal braces in one alternative do 
not suppress ranges in another, and add this mixed escaped-brace case to the 
coverage.



##########
fe/fe-connector/fe-connector-hudi/src/main/java/org/apache/doris/connector/hudi/HudiConnectorMetadata.java:
##########
@@ -922,6 +927,42 @@ private List<ConnectorPartitionInfo> 
restrictToPin(HudiTableHandle handle, List<
         return atPin;
     }
 
+    private List<String> hmsPartitionPaths(HudiTableHandle handle, 
List<String> names) {
+        List<String> encodedNames = names.stream().filter(name -> 
name.indexOf('%') >= 0)
+                .collect(Collectors.toList());
+        if (encodedNames.isEmpty()) {
+            return names;
+        }
+        // Hive sync can register an already escaped Hudi value, which HMS 
escapes again in its name.
+        // The storage location identifies the physical path regardless of the 
sync extractor's decoding
+        // policy. Decode that path only in parsePartitionValues, preserving 
literal percent sequences.
+        List<HmsPartitionInfo> partitions = hmsClient.getPartitions(

Review Comment:
   [P2] Tolerate partitions deleted after the cached name listing
   
   With `use_hive_sync_partition=true` and 
`meta.cache.hive.partition.enable=false` (the name cache remains enabled), 
cache a listing containing an encoded partition, then drop that partition in 
HMS. The next filtered query for a surviving partition still passes the stale 
encoded name here, and strict `getPartitions` throws for the missing result 
before `prunePartitionPaths` can discard it. Object-cache expiry or eviction 
causes the same failure, so retries can keep failing until the names cache is 
refreshed. Use an omission-tolerant lookup such as `getExistingPartitions` and 
associate surviving results by partition identity, omitting deleted names; 
retain errors for malformed results. Add a cached-name/deleted-partition case 
to the tests.



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

Reply via email to