Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Quote by Default ([#241](https://github.com/databricks/dbt-databricks/pull/241))
- Avoid show table extended command. ([#231](https://github.com/databricks/dbt-databricks/pull/231))
- Use show table extended with table name list for get_catalog. ([#237](https://github.com/databricks/dbt-databricks/pull/237))
- Add support for a glob pattern in the databricks_copy_into macro ([#259](https://github.com/databricks/dbt-databricks/pull/259))

## dbt-databricks 1.3.2 (November 9, 2022)

Expand Down
7 changes: 7 additions & 0 deletions dbt/include/databricks/macros/copy_into.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
source_encryption=none,
validate=none,
files=none,
pattern=none,
format_options=none,
copy_options=none) -%}

Expand Down Expand Up @@ -47,13 +48,19 @@
from {{ source_clause }}
fileformat = {{ file_format }}
{% if validate -%} validate {{ validate }} {%- endif %}
{% if files and pattern %}
{{ exceptions.raise_compiler_error("You can only specify one of 'files' or 'pattern'") }}
{% endif %}
{% if files -%}
files = (
{%- for file in files -%}
'{{ file }}' {%- if not loop.last %}, {% endif -%}
{%- endfor -%}
)
{%- endif %}
{% if pattern -%}
pattern = '{{ pattern }}'
{%- endif %}
{% if format_options -%}
format_options (
{%- for key in format_options -%}
Expand Down