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

feat: allow row count in Snowflake #11994

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 @@ -4,6 +4,7 @@

from datahub.configuration.pattern_utils import is_schema_allowed
from datahub.emitter.mce_builder import (
get_sys_time,
make_data_platform_urn,
make_dataset_urn_with_platform_instance,
make_schema_field_urn,
Expand Down Expand Up @@ -77,6 +78,7 @@
)
from datahub.metadata.com.linkedin.pegasus2avro.dataset import (
DatasetProperties,
DatasetProfileClass,
ViewProperties,
)
from datahub.metadata.com.linkedin.pegasus2avro.schema import (
Expand Down Expand Up @@ -741,6 +743,19 @@ def gen_dataset_workunits(
entityUrn=dataset_urn, aspect=view_properties_aspect
).as_workunit()

# if there is no profiling, still send the row count
if not self.profiler:
if table_row_count := table.rows_count:
datasetProfile = DatasetProfileClass(
timestampMillis=get_sys_time(),
rowCount=table_row_count,
sizeInBytes=table.size_in_bytes,
columnCount=len(table.columns),
)
yield MetadataChangeProposalWrapper(
entityUrn=dataset_urn, aspect=datasetProfile
).as_workunit()

def get_dataset_properties(
self,
table: Union[SnowflakeTable, SnowflakeView],
Expand Down
Loading