Repository navigation
Description
Detail Bug Report
Introduced in #34634 by @harshsoni2024 on Oct 5, 2026
Summary
- Context:
ExternalTableLineageMixinis shared by the Snowflake, Glue, Redshift, Athena, Databricks and Unity Catalog database sources to link an external table to the storageContainerholding its data, by resolving the table's reported location against the container index via an exact-matchfullPathsearch. - Bug: The helper
container_lookup_pathsiningestion/src/metadata/ingestion/source/database/external_table_lineage_mixin.pyde-aliases only the Hadoop S3 schemes (s3a/s3n->s3) before the exact-match lookup, but the GCS storage connector indexes every container undergs://, while catalog sources report GCS locations asgcs://— so those lookups can never match. - Actual vs. expected: A GCS-backed external table whose location is reported as
gcs://bucket/keyemits no container-table lineage edge, even though the storage service was ingested and the container exists; the expected behavior (and the working behavior for every other scheme) is to de-aliasgcstogsand emit the edge. - Impact: Every external table backed by Google Cloud Storage (e.g. Snowflake external tables on GCS stages) silently loses both its table-level and column-level container lineage, and the only hint is a debug-level log message that misleadingly tells the user to "ingest the storage service" it already ingested.
Code with Bug
# ingestion/src/metadata/ingestion/source/database/external_table_lineage_mixin.py
_SCHEME_ALIASES = {"s3a": "s3", "s3n": "s3"} # <-- BUG 🔴 missing gcs->gs alias
def container_lookup_paths(location: str | None) -> list[str]:
...
if match := _SCHEME_PATTERN.match(location):
scheme = match.group(1).lower()
path = location[match.end() :]
canonical = f"{_SCHEME_ALIASES.get(scheme, scheme)}://{path}" # <-- BUG 🔴 canonical stays gcs:// so can't match gs:// containers# ingestion/src/metadata/ingestion/source/storage/gcs/metadata.py
full_path = f"gs://{self._clean_path(bucket_name)}" # <-- container index uses gs://Explanation
The container lookup uses an exact match on fullPath (via es_search_container_by_path) and performs no server-side normalization. The GCS storage connector writes containers as gs://..., but some database sources (notably Snowflake) report external locations as gcs://.... Since container_lookup_paths does not translate gcs to gs, it only searches for gcs://... candidates, so the lookup never finds the existing container and the mixin silently skips emitting container→table (and downstream column) lineage.
Codebase Inconsistency
ingestion/src/metadata/ingestion/source/database/unitycatalog/path_utils.py already normalizes "gcs": "gs" (along with several other aliases) for the same es_search_container_by_path lookup, indicating the shared mixin is missing a required alias.
Recommended Fix
Add "gcs": "gs" to _SCHEME_ALIASES in ingestion/src/metadata/ingestion/source/database/external_table_lineage_mixin.py (and consider mirroring the alias set in unitycatalog/path_utils.py). Also apply equivalent de-aliasing in ingestion/src/metadata/ingestion/source/database/snowflake/lineage.py::_resolve_container_by_path, which currently does a single exact lookup on the raw COPY_HISTORY.stage_location.
History
This bug was introduced in commit 39279a9 (#34634, "fix(glue): match external table locations with a trailing slash to their containers", Harsh Soni, 2026-10-05). That change added container_lookup_paths and _SCHEME_ALIASES to normalize only s3a/s3n -> s3, omitting gcs -> gs.
Activity
Fixes open-metadata#37301: de-alias gcs:// to gs:// in external table…
chore(release): merge main into 2.1 (#38229)