diff --git a/metadata-ingestion/src/datahub/ingestion/source/mongodb.py b/metadata-ingestion/src/datahub/ingestion/source/mongodb.py index 577da91ee82da..e30e16e774cd5 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/mongodb.py +++ b/metadata-ingestion/src/datahub/ingestion/source/mongodb.py @@ -421,7 +421,7 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: ) collection_fields = sorted( collection_schema.values(), - key=lambda x: x["count"], + key=lambda x: (x["count"], x["delimited_name"]), reverse=True, )[0:max_schema_size] # Add this information to the custom properties so user can know they are looking at downsampled schema