Closed mikkosulonen closed 7 months ago
Thinking out loud here...
Why do we need an external table to have partitions for manual refresh?
With defaults, ie. not configuring either:
{% set manual_refresh = (partitions and not auto_refresh) %}
evaluates to
{% set manual_refresh = (none and not false) %}
{% set manual_refresh = (none and true) %}
{% set manual_refresh = none %}
Looking at the documentation at: https://docs.snowflake.com/en/user-guide/tables-external-intro.html#partitioned-external-tables and based on our use-case, I see no reason why dbt-external-tables is requiring both of them 🤷♂️
If my thinking is correct, a fix would be as simple as:
{% set manual_refresh = (partitions or not auto_refresh) %}
But that still leaves the question of why having partitions would require manual refresh. Manual partitions do require manual refreshing https://docs.snowflake.com/en/user-guide/tables-external-intro.html#partitions-added-manually, but automatic partitioning does not require manual refresh https://docs.snowflake.com/en/user-guide/tables-external-intro.html#partitions-added-automatically
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.
Describe the bug
Snowflake manual refresh doesn't work without partitions
Steps to reproduce
dbt run-operation stage_external_sources
A snippet with names redacted from one sources.yml
Expected results
Actual results
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
dbt Cloud
The output of
python --version
:Additional context
Quick'n'dirty "fix" I tried and verified the issue:
https://github.com/dbt-labs/dbt-external-tables/blob/2a407bf4e99dbd3f479f4d8856312edcef01a675/macros/plugins/snowflake/refresh_external_table.sql#L9
Changing to:
{% set manual_refresh = true %}
I'll get the expected results.
The use case we have is that we have an independent archival mechanism in our source datalake. We don't have any partitions, we just want to keep adding the currently available files to the external table metadata and delete the ones that have been archived.