creamy-table-83685
01/26/2023, 11:51 PMrs_database and rs_schema
in the dbt_project.yml?
Or my little test set of data has something corrupt? (the test data set was created by rudderstack it sent to my big query from the standard .js tracking script source, and the pages and pages_view tables look normal/have data.
for BigQuery.. what should the rs_database name be? (I've tried a bunch of permutations.. but I assume it's the name of the bigquery which has inside it all of the datasets... and for rs_schema, I just supply the name of the dataset that rudderstack created, which contains the pages and page_view tables ( when clicking the 3 dots next to the dataset, choosing 'copy id' I get database.dataset < not my actual names).. but for schema I've tried dataset, database.dataset and all kinds of things)... thank you so much for your help!! Once I can do this, I can then get onto user stitching and everything else... just stumbling here on the basics.
I've loaded up the rudder-event-analytics git, replaced the rs_database and rs_schema vars.... but maybe not properly for BigQuery? When I run dbt build... at first it seems to go OK,, the running node model, acquiring new bigqueryconnection is all going... then it goes to this step:
`create or replace table cschatbot.csDevAnalytics.`rs_stg_user_first_touch``
below that shows OPTIONS()... and shows all the code etc... then below that:
Database Error in model rs_stg_user_first_touch (models/intermediate/rs_stg_user_first_touch.sql)
Syntax error: Illegal escape sequence: \. at [31:76]
I looked at what's on rs_stg_user_first_touch.sql at that spot and it's:
first_value(source_medium) over ( ... rest of that function...
As far as I can tell... this means something invalid was passed in as source_medium?
I have like 5 rows of data from just testing out the .js snippet, which Rudderstack successfully wrote into the DB... so either one of the rows is corrupt (how? I just followed the tutorials.. and loaded this and that page with some urls like .local?utm_source="testing" etc... and some URL's with no UTMs.)
Or... it's not getting anything? The docs say to put in the 'database name' for the var rs_database but I'm actually not sure which thing in BigQuery to use..
For the database name is that the dataset, or databasename.dataset? I was assuming I'd go to the dataset, click the 3 dot menu then use the copy ID which gives me cschatbot.credit_suite_com where cschatbot is the name of the bigquery, and credit_suite_com is the dataset rudderstack created when it synced my events from the .js source.creamy-table-83685
01/27/2023, 12:09 AMtracks and identifies tables added (there is already a pages and pages_view tables from the first sync I did from rudderstack.. I did not get any errors in dbt from running dbt deps .. however there are no tracks or identifies tables in the dataset that currently contains the pages and pages_view tables...curved-oil-33974
01/27/2023, 11:03 AMcurved-oil-33974
01/27/2023, 2:22 PMcreamy-table-83685
01/27/2023, 4:51 PMplain-parrot-49913
01/27/2023, 11:05 PMplain-parrot-49913
01/27/2023, 11:05 PMcreamy-table-83685
01/28/2023, 10:41 PMcreamy-table-83685
01/30/2023, 7:01 PMwith customers as (
select
id as customer_id,
first_name,
last_name
from `dbt-tutorial`.jaffle_shop.customers
),
telling DBT where the table is requires prepending the BigQuery table name inside of `` followed by the dataset, followed by the table name. If I look at their copy/paste code for redshift for example, that same code just directly states the schema.table:
with customers as (
select
id as customer_id,
first_name,
last_name
from jaffle_shop.customers
),creamy-table-83685
01/30/2023, 7:39 PMcreamy-table-83685
01/30/2023, 9:04 PMcreamy-table-83685
01/30/2023, 10:39 PMcreamy-table-83685
01/30/2023, 10:39 PMcreamy-table-83685
01/30/2023, 10:39 PMplain-parrot-49913
01/30/2023, 10:40 PMcreamy-table-83685
01/30/2023, 10:41 PMcreamy-table-83685
01/30/2023, 10:41 PMplain-parrot-49913
01/30/2023, 10:41 PMcreamy-table-83685
01/30/2023, 10:41 PMplain-parrot-49913
01/30/2023, 10:41 PMplain-parrot-49913
01/30/2023, 10:41 PMcreamy-table-83685
01/30/2023, 10:42 PMcreamy-table-83685
02/03/2023, 11:49 PM{% macro to_date(timestamp_col) %}
{{timestamp_col}}
{% if target.type == 'snowflake' %}
to_date({{timestamp_col}})
{% elif target.type == 'redshift' %}
2. in rs_stg_session_metrics, change line 4 to:
*, TIMESTAMP_DIFF(session_end_time, session_start_time, SECOND) as session_length
3. in reporting_dims.sql, escape the escapes in the regex
regexp_replace(
regexp_replace({{ var('col_referring_domain') }}, '^www\\.', ''),
'\\.com(\\.\\w+)?$|\\.co(\\.\\w+)?$|\\.org$',
''
)
... I'm pretty sure that's it... also heads up.. utm_campaign and utm_term are not considered in the original, and there are also some assumptions around what your team may use for utm_medium that will get converted to "paid search" for example.. those are pretty easy to find/fix... and adding in utm_campaign as a column in the rs_stg_user_first_touch output table wasn't too hard either.. I think I'm going to add in the utm_term as well... or use snowflake and it works with no fuss! thanks to Sara for her time, and highly recommend ask Chat GPT why things don't work lol. It's surprisingly capable.gentle-petabyte-80785
02/04/2023, 10:48 AMcreamy-table-83685
02/05/2023, 4:53 AMcreamy-table-83685
02/05/2023, 4:55 AM