-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Destination BIgQuery can handle nulls inside arrays (#14522)
- Loading branch information
Showing
26 changed files
with
500 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
...malization_test_output/bigquery/test_simple_streams/modified_models/generated/sources.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
version: 2 | ||
sources: | ||
- name: test_normalization | ||
quoting: | ||
database: true | ||
schema: false | ||
identifier: false | ||
tables: | ||
- name: _airbyte_raw_dedup_cdc_excluded | ||
- name: _airbyte_raw_dedup_exchange_rate | ||
- name: _airbyte_raw_exchange_rate | ||
- name: _airbyte_raw_renamed_dedup_cdc_excluded | ||
- name: test_normalization | ||
quoting: | ||
database: true | ||
schema: false | ||
identifier: false | ||
tables: | ||
- name: _airbyte_raw_dedup_cdc_excluded | ||
- name: _airbyte_raw_dedup_exchange_rate | ||
- name: _airbyte_raw_exchange_rate | ||
- name: _airbyte_raw_renamed_dedup_cdc_excluded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...ut/postgres/test_nested_streams/first_output/airbyte_tables/test_normalization/arrays.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
|
||
create table "postgres".test_normalization."arrays__dbt_tmp" | ||
as ( | ||
|
||
with __dbt__cte__arrays_ab1 as ( | ||
|
||
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema | ||
-- depends_on: "postgres".test_normalization._airbyte_raw_arrays | ||
select | ||
jsonb_extract_path(_airbyte_data, 'array_of_strings') as array_of_strings, | ||
|
||
jsonb_extract_path(table_alias._airbyte_data, 'nested_array_parent') | ||
as nested_array_parent, | ||
_airbyte_ab_id, | ||
_airbyte_emitted_at, | ||
now() as _airbyte_normalized_at | ||
from "postgres".test_normalization._airbyte_raw_arrays as table_alias | ||
-- arrays | ||
where 1 = 1 | ||
), __dbt__cte__arrays_ab2 as ( | ||
|
||
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type | ||
-- depends_on: __dbt__cte__arrays_ab1 | ||
select | ||
array_of_strings, | ||
cast(nested_array_parent as | ||
jsonb | ||
) as nested_array_parent, | ||
_airbyte_ab_id, | ||
_airbyte_emitted_at, | ||
now() as _airbyte_normalized_at | ||
from __dbt__cte__arrays_ab1 | ||
-- arrays | ||
where 1 = 1 | ||
), __dbt__cte__arrays_ab3 as ( | ||
|
||
-- SQL model to build a hash column based on the values of this record | ||
-- depends_on: __dbt__cte__arrays_ab2 | ||
select | ||
md5(cast(coalesce(cast(array_of_strings as text), '') || '-' || coalesce(cast(nested_array_parent as text), '') as text)) as _airbyte_arrays_hashid, | ||
tmp.* | ||
from __dbt__cte__arrays_ab2 tmp | ||
-- arrays | ||
where 1 = 1 | ||
)-- Final base SQL model | ||
-- depends_on: __dbt__cte__arrays_ab3 | ||
select | ||
array_of_strings, | ||
nested_array_parent, | ||
_airbyte_ab_id, | ||
_airbyte_emitted_at, | ||
now() as _airbyte_normalized_at, | ||
_airbyte_arrays_hashid | ||
from __dbt__cte__arrays_ab3 | ||
-- arrays from "postgres".test_normalization._airbyte_raw_arrays | ||
where 1 = 1 | ||
); |
Oops, something went wrong.