-
Notifications
You must be signed in to change notification settings - Fork 79
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
expectations break when expecting a Struct in BigQuery #166
Comments
I get exactly the same issue. I think if we use the bigquery function |
Please take a look at the latest release (0.4.0) and check if it fixes this issue. Thank you! |
I still get exactly the same behaviour. The generated SQL being run against bigquery has a group by struct column. This produces the bigquery error: "Grouping by expressions of type STRUCT is not allowed" . |
@dbrtly solution would work; however, the test subject would need modifying to use |
Hi @JakoboEU, can you post here the model and test that you are running? Did you apply a column transformation to all of the struct columns in the model? |
@psousa50 I used the same test as in the issue description.
which gets compiled to
|
HI @JakoboEU, I would like to see the full test, the |
Hi @psousa50 , I am not aware of any transformations. The whole test looks like
And I don't have anything defined in my |
Oh, I see the problem now 🙂 For you to be able to use STRUCT columns you need to apply a column transformation to those columns, as explained in the README here. Please refer to this use case for instructions on how to do it. If you have any issue implementing this please let me know, I'll try to assist you |
That's the ticket. Thank you. Works well. |
Cool 😎 |
Generating an expected result such as:
Results in the following SQL being run against BigQuery:
Which generates the following error:
Because
group by snapshot_date, event
is illegal due toevent
being a struct.dbt_unit_testing version:
dbt version:
The text was updated successfully, but these errors were encountered: