diff --git a/macros/streamline/bronze/streamline_external_table_query_v0.sql b/macros/streamline/bronze/streamline_external_table_query_v0.sql index 7f149971..603c9099 100644 --- a/macros/streamline/bronze/streamline_external_table_query_v0.sql +++ b/macros/streamline/bronze/streamline_external_table_query_v0.sql @@ -2,7 +2,8 @@ model, partition_function, balances = false, - block_number = true + block_number = true, + data_not_null = true ) %} WITH meta AS ( SELECT @@ -55,7 +56,9 @@ WHERE b.partition_key = s.partition_key AND DATA :error IS NULL - AND DATA IS NOT NULL + {% if data_not_null %} + AND DATA IS NOT NULL + {% endif %} {% endmacro %} {% macro v0_streamline_external_table_fr_query( @@ -63,7 +66,8 @@ partition_function, partition_join_key = "partition_key", balances = false, - block_number = true + block_number = true, + data_not_null = true ) %} WITH meta AS ( SELECT @@ -117,7 +121,9 @@ FROM WHERE b.partition_key = s.{{ partition_join_key }} AND DATA :error IS NULL - AND DATA IS NOT NULL + {% if data_not_null %} + AND DATA IS NOT NULL + {% endif %} {% endmacro %} {% macro v0_streamline_external_table_query_decoder( diff --git a/models/streamline/bronze/beacon/bronze__streamline_beacon_blocks.sql b/models/streamline/bronze/beacon/bronze__streamline_beacon_blocks.sql index 88b02e73..cbc55a94 100644 --- a/models/streamline/bronze/beacon/bronze__streamline_beacon_blocks.sql +++ b/models/streamline/bronze/beacon/bronze__streamline_beacon_blocks.sql @@ -4,5 +4,6 @@ {{ v0_streamline_external_table_query( model = "beacon_blocks_v2", partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)", - block_number = false + block_number = false, + data_not_null = false ) }} diff --git a/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v1.sql b/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v1.sql index acf34ae1..5248e86f 100644 --- a/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v1.sql +++ b/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v1.sql @@ -5,5 +5,6 @@ model = "beacon_blocks", partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER )", partition_join_key = "_partition_by_slot_id", - block_number = false + block_number = false, + data_not_null = false ) }} diff --git a/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v2.sql b/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v2.sql index d59e2539..c9cf1ea7 100644 --- a/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v2.sql +++ b/models/streamline/bronze/beacon/bronze__streamline_fr_beacon_blocks_v2.sql @@ -4,5 +4,6 @@ {{ v0_streamline_external_table_fr_query( model = "beacon_blocks_v2", partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER )", - block_number = false + block_number = false, + data_not_null = false ) }}