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

SAFE_CAST compilation error for BigQuery #33

Open
kennyning-current opened this issue Apr 7, 2023 · 1 comment
Open

SAFE_CAST compilation error for BigQuery #33

kennyning-current opened this issue Apr 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@kennyning-current
Copy link

kennyning-current commented Apr 7, 2023

I've set up my customer_stream according Activity Schema spec V2. I tried a basic funnel to start:

with

dataset_cte as (
    {{ dbt_activity_schema.dataset(
        activity_stream = ref("customer_stream"),

        primary_activity = dbt_activity_schema.activity(
            dbt_activity_schema.all_ever(), "opened_email"),

        appended_activities = [
          dbt_activity_schema.activity(
              dbt_activity_schema.first_after(), "deposited_payroll"),
           dbt_activity_schema.activity(
              dbt_activity_schema.first_after(), "visited_points_tab"),
        ]
    ) }}
)

select * from dataset_cte

And getting this error at this line in the compiled sql:
image

It looks like BigQuery's safe_cast function does not like casting json to string at all, so we might need a different approach:
image

@tnightengale
Copy link
Owner

@kennyning-current Would you mind taking a look at #26 for context, and perhaps open a PR to solve this for the BQ case?

@tnightengale tnightengale added the bug Something isn't working label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants