-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make BigQuery cache lookups case-insensitive #1810
Comments
hey @haukeduden - I think this is the normal and expected behavior of the
I think the issue you're seeing is that for the first run of a model, the destination table does not yet exist in the database. The
Here, It's certainly possible that there is some other cache-related bug at play here, but I'm not sure that the example code you sent through exercises that bug if it does exist. I'm going to close this issue out, but please feel free to follow up if I have the wrong idea - happy to discuss this further. |
Hi Drewbanin, |
@haukeduden thanks for the additional info. When I try to reproduce this, I do see dbt failing on the second invocation of If this is a cache-related issue, then it probably has something to do with the state of your particular BQ project. Does your project name or dataset name contain any interesting/special characters? When we've seen caching issues like this in the past, they usually had to do with case-sensitive comparisons in the cache lookup. Any chance your dataset is named something like |
Yes, the dataset has some camel-casing. It is called "AshData". |
I just tried again with a lower-case dataset name. Then I also get the expected error message on the second call. So it seems that this might indeed be caused by upper characters in the original dataset name. |
Thanks @haukeduden - that's super helpful. I appreciate you taking the time to report this one -- we'll take a look at fixing it! |
…nsitive Fix bigquery case sensitive caching issue (#1810)
UPDATE: added step 4 to reproduction recipe
Describe the bug
The is_incremental() macro always returns false when the target is BigQuery, effectively disabling the incremental build feature.
Steps To Reproduce
{{ config(materialized='incremental') }}
select 1 as id
{% if is_incremental() %}
THIS SHOULD CAUSE AN ERROR
{% endif %}
=> no error is displayed (bug)
=> error is displayed (expected behaviour)
Expected behavior
An error message should be displayed when calling "dbt run" because the SQL inside the is_incremental condition is invalid.
When running "dbt run --bypass-cache" the result is as expected.
Additional information
I did a little debugging and verified that is_incremental is indeed returning false. The cause is that adapter.get_relation apparently returns None. Since the problem vanishes when --bypass-cache is specified, I suspect that the problem is caused by a bug in the relation cache.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
macOS Mojave
The output of
python --version
:Python 3.7.4
The text was updated successfully, but these errors were encountered: