shnapz commented on code in PR #37265:
URL: https://github.com/apache/beam/pull/37265#discussion_r3274620502


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java:
##########
@@ -318,35 +317,10 @@ public final List<? extends FileBasedSource<T>> split(
     }
   }
 
-  /**
-   * Report source Lineage. Due to the size limit of Beam metrics, report full 
file name or only dir
-   * depend on the number of files.
-   *
-   * <p>- Number of files<=100, report full file paths;
-   *
-   * <p>- Number of directory<=100, report directory names (one level up);
-   *
-   * <p>- Otherwise, report top level only.
-   */
   private static void reportSourceLineage(List<Metadata> expandedFiles) {
-    if (expandedFiles.size() <= 100) {
-      for (Metadata metadata : expandedFiles) {
-        FileSystems.reportSourceLineage(metadata.resourceId());
-      }
-    } else {
-      HashSet<ResourceId> uniqueDirs = new HashSet<>();
-      for (Metadata metadata : expandedFiles) {
-        ResourceId dir = metadata.resourceId().getCurrentDirectory();
-        uniqueDirs.add(dir);
-        if (uniqueDirs.size() > 100) {
-          FileSystems.reportSourceLineage(dir, LineageLevel.TOP_LEVEL);
-          return;
-        }
-      }
-      for (ResourceId uniqueDir : uniqueDirs) {
-        FileSystems.reportSourceLineage(uniqueDir);
-      }
-    }
+    List<ResourceId> resourceIds =

Review Comment:
   I have reworked the approach. HadoopFormatIO now calls 
`Lineage.getSources().add(scheme, segments, "/")` directly like other IOs. The 
only changes are in HadoopFormatIO and HadoopFileSystem.



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