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

[FEATURE] catalog generation should include rowcounts of models where possible #230

Open
dataders opened this issue Sep 24, 2024 · 1 comment
Assignees
Labels
dw limitation DW or platform limitations

Comments

@dataders
Copy link
Collaborator

source: community Slack thread

If the data platform provides rowcounts as a column in the resultset of information_schema.tables, dbt adapters are able to fetch this information via dbt docs generate and store it in the catalog.json, so that it is available in the OSS dbt docs as well as dbt Cloud's Explore product.

one example is dbt-snowflake, which uses the snowflake__get_catalog_tables_sql() macro to fetch Row Count.

from @prdpsvs:

Unfortunately, [Fabric's information_schema] does not [contain rowcount info]. There are multiple ways to retrieve data from sys views/objects but none of them are 100%.
Two approaches can work but both are workarounds and not worth the effort but its upto developers.

  • Create stats and query row count using DBCC SHOW statistics
  • Use select count(1)

Perhaps one of these workarounds could be shipped in the adapter, but @prdpsvs would know best if doing so would:

  • not result in a noticible performance hit for users, and
  • be worthwhile if Fabric SQL will soon have rowcount in the info_schema
@prdpsvs
Copy link
Collaborator

prdpsvs commented Nov 28, 2024

Unfortunately, this is not currently possible without running dynamic SQL. Depending on number of objects, this could take a while. Warehouse needs to support this with one of the system views. Until then, can't do much

@prdpsvs prdpsvs added the dw limitation DW or platform limitations label Nov 28, 2024
@prdpsvs prdpsvs self-assigned this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dw limitation DW or platform limitations
Projects
None yet
Development

No branches or pull requests

2 participants