Skip to content

Commit

Permalink
Added null check for partitions batches
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-gust committed Aug 31, 2023
1 parent ba819cf commit 386a43c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
{%- set single_partition = [] -%}
{%- for col in row -%}


{%- set column_type = adapter.convert_type(table, loop.index0) -%}
{%- if column_type == 'integer' -%}
{%- set comp_func = '=' -%}
{%- if col is none -%}
{%- set value = 'null' -%}
{%- set comp_func = ' is ' -%}
{%- elif column_type == 'integer' -%}
{%- set value = col | string -%}
{%- elif column_type == 'string' -%}
{%- set value = "'" + col + "'" -%}
Expand All @@ -31,7 +36,7 @@
{%- do exceptions.raise_compiler_error('Need to add support for column type ' + column_type) -%}
{%- endif -%}
{%- set partition_key = adapter.format_one_partition_key(partitioned_by[loop.index0]) -%}
{%- do single_partition.append(partition_key + '=' + value) -%}
{%- do single_partition.append(partition_key + comp_func + value) -%}
{%- endfor -%}

{%- set single_partition_expression = single_partition | join(' and ') -%}
Expand Down

0 comments on commit 386a43c

Please sign in to comment.