talatuyarer commented on code in PR #35582:
URL: https://github.com/apache/beam/pull/35582#discussion_r2205698294


##########
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/parquet/ParquetTable.java:
##########
@@ -122,4 +127,27 @@ public IsBounded isBounded() {
   public ProjectSupport supportsProjects() {
     return ProjectSupport.WITH_FIELD_REORDERING;
   }
+
+  private String resolveFilePattern(String location) {
+    try {
+      MatchResult match = FileSystems.match(location);
+      if (match.status() == MatchResult.Status.OK && 
!match.metadata().isEmpty()) {
+        MatchResult.Metadata metadata = match.metadata().get(0);
+        if (metadata.resourceId().isDirectory()) {
+          String dirPath = metadata.resourceId().toString();
+          if (dirPath.endsWith("/")) {
+            return dirPath + "*";
+          } else {
+            return dirPath + "/*";
+          }
+        }
+      }
+    } catch (IOException e) {
+      LOG.warn(

Review Comment:
   Thank you @Abacn This is good call out that i  forgot it. Let me change this 
function behavior in a way If location ends with "/", it's treated as a 
directory. Otherwise, it's treated as a glob or a single file path.
   
   ```java
     private String resolveFilePattern(String location) {
       if (location.endsWith("/")) {
         return location + "*";
       }
       return location;
     }
   ```



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to