File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ code: |
20
20
create or replace temp table code as
21
21
22
22
with filepaths as (
23
+
23
24
select
24
25
lax_string(file.path) as path,
25
26
from unnest(
@@ -29,13 +30,13 @@ code: |
29
30
)
30
31
) as file
31
32
where ends_with(lax_string(file.path), '.sql')
33
+
32
34
),
33
35
34
36
35
37
files_content as (
36
38
37
39
select
38
-
39
40
regexp_replace(replace(replace(replace(
40
41
lower(path),
41
42
'/', '__'),
@@ -61,14 +62,19 @@ code: |
61
62
'create or replace table function `%s`.%s(start_date string, end_date string) as',
62
63
destination_dataset, name
63
64
) ||
64
- replace(regexp_replace(regexp_replace(
65
+ replace(replace(replace(replace( regexp_replace(regexp_replace(
65
66
'\n' || content,
66
67
'^DECLARE.*', ''),
67
68
'\nDECLARE.*', ''),
68
- 'project.dataset', ga4_dataset
69
+ 'project.dataset', ga4_dataset),
70
+ 'your-project-id.your-dataset-id', ga4_dataset),
71
+ 'your-project-id.dataset_name', ga4_dataset),
72
+ 'your-project-id.analytics_1234567890', ga4_dataset
69
73
)
70
74
) as code
71
75
from files_content
76
+ where not starts_with(name, 'bigquery_administration')
77
+ order by name
72
78
;
73
79
74
80
You can’t perform that action at this time.
0 commit comments