-
Notifications
You must be signed in to change notification settings - Fork 163
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
[Bug] --empty flag not working on Pseudo-columns #1243
Comments
@christopherekfeldt Thanks for the report! The mechanism we're using for The first idea that came to mind:
select *, _PARTITIONTIME as partition_time
from dbt_jcohen.myingestiontable
where false limit 0 Other ideas:
|
In the meantime, you can at least avoid the error by specifying If we added support for {% set src_cpc_raw = source('customer_preference_center', 'customer_preference') -%}
select
...,
_PARTITIONTIME as ingestion_dt
from
{{ src_cpc_raw.render() }}, -- this will be rendered simply into `project.dataset.identifier` (no subquery)
unnest(centralPreferences) as centralPreferences
where 1=1
{% if flags.EMPTY %}
and false limit 0 -- instead, I manually add the "empty limit" here
{% endif %}
{% if is_incremental() %}
and date(ingestion_dt) >= date_sub("{{ latest_partition_filter(src_cpc_raw) }}", interval 1 day)
{% endif %}
qualify row_number() over (partition by customerId_token, preference order by updateTS desc, ingstn_ts desc) = 1 |
My suggestion to solve this issue is related to dbt-labs/dbt-core#8560: For sources, we could have a way to add a parameter to the macro to add those metadata fields and for refs, since it would be related to |
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. |
Is this a new bug in dbt-bigquery?
Current Behavior
When trying out the empty flag on my models I get failures on all models that uses the pseudo-column "_PARTITIONTIME" in their logic. Here is my query, it has worked perfectly fine prior.
But now it has swapped out the logic with a subquery that doesn't take the pseudo column into consideration:
Giving the error in BigQuery: "Unrecognized name: _PARTITIONTIME at [37:9]"
Expected Behavior
I expect the subquery to work with pseudo-columns as well.
Steps To Reproduce
Relevant log output
No response
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: