Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable blob level Lineage metrics for FileSystems #32642

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected String getScheme() {
protected void reportLineage(GcsResourceId resourceId, Lineage lineage) {
GcsPath path = resourceId.getGcsPath();
if (!path.getBucket().isEmpty()) {
lineage.add("gcs", ImmutableList.of(path.getBucket(), path.getObject()));
lineage.add("gcs", ImmutableList.of(path.getBucket()));
} else {
LOG.warn("Report Lineage on relative path {} is unsupported", path.getObject());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ protected S3ResourceId matchNewResource(String singleResourceSpec, boolean isDir

@Override
protected void reportLineage(S3ResourceId resourceId, Lineage lineage) {
lineage.add("s3", ImmutableList.of(resourceId.getBucket(), resourceId.getKey()));
lineage.add("s3", ImmutableList.of(resourceId.getBucket()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ protected S3ResourceId matchNewResource(String singleResourceSpec, boolean isDir

@Override
protected void reportLineage(S3ResourceId resourceId, Lineage lineage) {
lineage.add("s3", ImmutableList.of(resourceId.getBucket(), resourceId.getKey()));
lineage.add("s3", ImmutableList.of(resourceId.getBucket()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,6 @@ protected AzfsResourceId matchNewResource(String singleResourceSpec, boolean isD

@Override
protected void reportLineage(AzfsResourceId resourceId, Lineage lineage) {
if (!Strings.isNullOrEmpty(resourceId.getBlob())) {
lineage.add(
"abs",
ImmutableList.of(
resourceId.getAccount(), resourceId.getContainer(), resourceId.getBlob()));
} else {
lineage.add("abs", ImmutableList.of(resourceId.getAccount(), resourceId.getContainer()));
}
lineage.add("abs", ImmutableList.of(resourceId.getAccount(), resourceId.getContainer()));
}
}
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/io/aws/s3filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,6 @@ def report_lineage(self, path, lineage):
except ValueError:
# report lineage is fail-safe
return
if len(components) > 1:
components = components[:-1]
lineage.add('s3', *components)
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/io/azure/blobstoragefilesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,6 @@ def report_lineage(self, path, lineage):
except ValueError:
# report lineage is fail-safe
return
if len(components) > 1:
components = components[:-1]
lineage.add('abs', *components)
4 changes: 2 additions & 2 deletions sdks/python/apache_beam/io/gcp/gcsfilesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ def delete(self, paths):

def report_lineage(self, path, lineage):
try:
bucket, blob = gcsio.parse_gcs_path(path)
bucket, _ = gcsio.parse_gcs_path(path)
except ValueError:
# report lineage is fail-safe
return
lineage.add('gcs', bucket, blob)
lineage.add('gcs', bucket)
Loading