Skip to content
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

Nested fields for BigQuery #3954

Open
charles-astrafy opened this issue Dec 8, 2022 · 6 comments
Open

Nested fields for BigQuery #3954

charles-astrafy opened this issue Dec 8, 2022 · 6 comments
Labels
🎮 CLI This issue is related to the CLI tool ✨ feature-request Request for a new feature or functionality

Comments

@charles-astrafy
Copy link

Description

The "lightdash generate" CLI does not handle STRUCT fields in BigQuery. It only creates an entry in the yaml file for the top level field.

What problem does this solve?

It would allow data teams to have complete dbt properties files for their BigQuery tables that contain STRUCT fields. At the time being, those nested fields need to be added manually.

The logic to recursively go through the nested fields and adding those to a yaml file is present in the macro of this codegene package:
https://github.com/dbt-labs/dbt-codegen/blob/main/macros/generate_model_yaml.sql

@charles-astrafy charles-astrafy added the ✨ feature-request Request for a new feature or functionality label Dec 8, 2022
@TuringLovesDeathMetal TuringLovesDeathMetal added the 🎮 CLI This issue is related to the CLI tool label Dec 9, 2022
@TuringLovesDeathMetal
Copy link
Contributor

Thanks for opening this @charles-astrafy !

Have you tested using unnested structs in Lightdash as well? (e.g. if you add a dimension as one of the keys in the struct, does Lightdash complain?).

I have a feeling that we don't actually unnest the structs so they still might appear as dictionaries/containers in a single column...so there might be an issue to solve before this which is handling unnested structs in Lightdash.

@charles-astrafy
Copy link
Author

Hello @TuringLovesDeathMetal ,

Structs are not supported by Lightdash and it throws an error when we try to use tables that have structs. Definitely a feature that would be good as well to see implemented.

But here our concern is more about generating the dbt property files correctly even if the struct are not supported yet. We would like the property files to have already the good structure so we can document it. For instance if there is the following struct in BigQuery:

Address:
-city
-zip_code

that the dbt property file generated by lightdash be as follows:

  • name: address
    description: "structure containing address information"
  • name: address.city
    description: "..."
  • name: address.zip_code
    description: "..."

Having Lightdash being then able to handle the structs is I think more complex and would hopefully come in a later iteration.

@stale
Copy link

stale bot commented Feb 8, 2023

Is this issue still relevant? There have been no updates for 60 days, please close the issue or keep the conversation going!

@stale stale bot added the stale Issue hasn't been updated for 60 days label Feb 8, 2023
@crmne
Copy link

crmne commented Jun 1, 2023

This is very interesting for us and it is blocking our adoption of lightdash, since we heavily use STRUCTS in our data warehouse.

@stale stale bot removed the stale Issue hasn't been updated for 60 days label Jun 1, 2023
@yu-iskw
Copy link
Contributor

yu-iskw commented Jul 3, 2023

+1

@tonytusharjr
Copy link

+1, I have a client solution relying on structs and this would unlock migrating that client off of Looker Studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎮 CLI This issue is related to the CLI tool ✨ feature-request Request for a new feature or functionality
Projects
None yet
Development

No branches or pull requests

5 participants