Skip to content

Commit 78d0e03

Browse files
committed
deploy: 39c7b03
1 parent af1a415 commit 78d0e03

File tree

68 files changed

+2670
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2670
-0
lines changed

docs/catalog.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
with
2+
3+
height as (
4+
5+
select * from "neondb"."dbt_testing_example"."stg_gym_app__height"
6+
7+
),
8+
9+
weight as (
10+
11+
select * from "neondb"."dbt_testing_example"."stg_gym_app__weight"
12+
13+
),
14+
15+
enrich_with_lasted_height_recorded_before_the_weight_measurement as (
16+
17+
select
18+
weight.created_date,
19+
user_id,
20+
weight,
21+
(select height
22+
from height
23+
where height.created_date < weight.created_date and
24+
height.user_id = weight.user_id
25+
order by height.created_date DESC
26+
limit 1) as height
27+
from weight
28+
)
29+
30+
select * from enrich_with_lasted_height_recorded_before_the_weight_measurement
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
4+
5+
6+
7+
8+
with nothing as (select 1 as num)
9+
select * from nothing where num = 2
10+
11+
12+
13+
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
4+
5+
6+
with nothing as (select 1 as num)
7+
select * from nothing where num = 2
8+
9+
10+
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
with nothing as (select 1 as num)
10+
select * from nothing where num = 2
11+
12+
13+
14+
15+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
4+
5+
with child as (
6+
select user_id as from_field
7+
from "neondb"."dbt_testing_example"."body_mass_indexes"
8+
where user_id is not null
9+
),
10+
11+
parent as (
12+
select user_id as to_field
13+
from "neondb"."dbt_testing_example"."raw_height"
14+
)
15+
16+
select
17+
from_field
18+
19+
from child
20+
left join parent
21+
on child.from_field = parent.to_field
22+
23+
where parent.to_field is null
24+
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
4+
5+
with child as (
6+
select user_id as from_field
7+
from "neondb"."dbt_testing_example"."body_mass_indexes"
8+
where user_id is not null
9+
),
10+
11+
parent as (
12+
select user_id as to_field
13+
from "neondb"."dbt_testing_example"."raw_weight"
14+
)
15+
16+
select
17+
from_field
18+
19+
from child
20+
left join parent
21+
on child.from_field = parent.to_field
22+
23+
where parent.to_field is null
24+
25+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
with
2+
3+
weights_with_latest_height as (
4+
5+
select * from "neondb"."dbt_testing_example"."int_weight_measurements_with_latest_height"
6+
7+
),
8+
9+
body_mass_indexes as (
10+
11+
select
12+
created_date,
13+
user_id,
14+
weight,
15+
height,
16+
round((weight::numeric / (height::numeric / 100) ^ 2)::numeric, 1) as bmi,
17+
current_timestamp as processed_at
18+
from weights_with_latest_height
19+
)
20+
21+
select * from body_mass_indexes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
with relation_columns as (
2+
3+
4+
select
5+
cast('DATE' as TEXT) as relation_column,
6+
cast('TEXT' as TEXT) as relation_column_type
7+
union all
8+
9+
select
10+
cast('USER_ID' as TEXT) as relation_column,
11+
cast('INTEGER' as TEXT) as relation_column_type
12+
union all
13+
14+
select
15+
cast('HEIGHT' as TEXT) as relation_column,
16+
cast('DOUBLE PRECISION' as TEXT) as relation_column_type
17+
union all
18+
19+
select
20+
cast('HEIGHT_UNIT' as TEXT) as relation_column,
21+
cast('TEXT' as TEXT) as relation_column_type
22+
23+
24+
),
25+
test_data as (
26+
27+
select
28+
*
29+
from
30+
relation_columns
31+
where
32+
relation_column = 'HEIGHT'
33+
and
34+
relation_column_type not in ('DOUBLE PRECISION')
35+
36+
)
37+
select *
38+
from test_data
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
with relation_columns as (
2+
3+
4+
select
5+
cast('DATE' as TEXT) as relation_column,
6+
cast('TEXT' as TEXT) as relation_column_type
7+
union all
8+
9+
select
10+
cast('USER_ID' as TEXT) as relation_column,
11+
cast('INTEGER' as TEXT) as relation_column_type
12+
union all
13+
14+
select
15+
cast('HEIGHT' as TEXT) as relation_column,
16+
cast('DOUBLE PRECISION' as TEXT) as relation_column_type
17+
union all
18+
19+
select
20+
cast('HEIGHT_UNIT' as TEXT) as relation_column,
21+
cast('TEXT' as TEXT) as relation_column_type
22+
23+
24+
),
25+
test_data as (
26+
27+
select
28+
*
29+
from
30+
relation_columns
31+
where
32+
relation_column = 'USER_ID'
33+
and
34+
relation_column_type not in ('INTEGER')
35+
36+
)
37+
select *
38+
from test_data

0 commit comments

Comments
 (0)