Skip to content

Commit

Permalink
fix(FIR-36503): Remove incorrect syntax in COPY logic (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiurin authored Sep 11, 2024
1 parent e3c5450 commit 205cd27
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .changes/unreleased/Fixed-20240910-171459.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: Fixed
body: Fixed default arguments for copy stategy when they would appear empty when not
specified.
time: 2024-09-10T17:14:59.352269+01:00
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ sources:
object_pattern: '*raw_customers.csv'
type: CSV
auto_create: true
allow_column_mismatch: false
max_errors_per_file: 10
csv_options:
header: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
(
{%- for column in columns -%}
{{ column.name }}
{%- if column.default is not none %} DEFAULT {{ column.default }}{% endif %}
{%- if column.source_column_name is not none %} {{ '$' ~ loop.index0 }}{% endif %}
{%- if column.default %} DEFAULT {{ column.default }}{% endif %}
{%- if column.source_column_name %} {{ '$' ~ loop.index0 }}{% endif %}
{{- ',' if not loop.last }}
{%- endfor -%}
)
Expand All @@ -83,10 +83,10 @@
{%- if options.type %}
TYPE = {{ options.type }}
{%- endif %}
{%- if options.auto_create is not none %}
{%- if options.auto_create %}
AUTO_CREATE = {{ options.auto_create | upper }}
{%- endif %}
{%- if options.allow_column_mismatch is not none %}
{%- if options.allow_column_mismatch %}
ALLOW_COLUMN_MISMATCH = {{ options.allow_column_mismatch | upper }}
{%- endif %}
{%- if options.error_file %}
Expand All @@ -99,7 +99,7 @@
MAX_ERRORS_PER_FILE = {{ options.max_errors_per_file }}
{%- endif %}
{%- if csv_options %}
{%- if csv_options.header is not none %}
{%- if csv_options.header %}
HEADER = {{ csv_options.header | upper }}
{%- endif %}
{%- if csv_options.delimiter %}
Expand All @@ -117,10 +117,10 @@
{%- if csv_options.null_string %}
NULL_STRING = '{{ csv_options.null_string }}'
{%- endif %}
{%- if csv_options.empty_field_as_null is not none %}
{%- if csv_options.empty_field_as_null %}
EMPTY_FIELD_AS_NULL = {{ csv_options.empty_field_as_null | upper }}
{%- endif %}
{%- if csv_options.skip_blank_lines is not none %}
{%- if csv_options.skip_blank_lines %}
SKIP_BLANK_LINES = {{ csv_options.skip_blank_lines | upper }}
{%- endif %}
{%- if csv_options.date_format %}
Expand Down

0 comments on commit 205cd27

Please sign in to comment.