-
Notifications
You must be signed in to change notification settings - Fork 505
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
[BigQuery] at_least_one test of nested struct field gives error since 1.1.0 #823
Comments
I want to contribute to this, but before I proceed I have a question. |
Thanks @vinit2107 ! column(field_struct.field1 -> field1) -- that is correct Along with column names, I would also need to rename the group by columns as someone can pass "field_struct.field1" as a group by column. -- correct. For any test the parameter column name could contain one or more dots like
results in (in json format):
Thus the For this particular test a solution would be:
After the pruned_rows CTE you will have a field called |
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
When I want to test
at_least_one
on afield_a
within a structfield_struct
, the test fails with BigQuery error:This occurs since version 1.1.0 and likely because of this commit.
When pasting the compiled test query into the BigQuery editor it shows:
A possible solution would be to use an alias for the nested field:
and use that alias
field_struct__field_a
in the subsequent steps.EDIT: you could also just use a default alias
at_least_one_field
:Steps to reproduce
Create a DBT model (table) containing a struct field:
Add
dbt_utils.at_least_one
test to the nestedfield_a
.Expected results
I would expect the test to succeed as it did with dbt_utils < 1.1.0
Actual results
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
no
Are you interested in contributing the fix?
currently not
The text was updated successfully, but these errors were encountered: