Skip to content

Commit

Permalink
Merge pull request #493 from elephantmetropolis/elephantmetropolis/su…
Browse files Browse the repository at this point in the history
…pport-per_thread_output-parameter-for-external-materialization

add support for per_thread_output in external materialization
  • Loading branch information
jwills authored Dec 18, 2024
2 parents 6b539a6 + 9238d85 commit 0da066b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dbt/adapters/duckdb/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ def external_write_options(self, write_location: str, rendered_options: dict) ->

@available
def external_read_location(self, write_location: str, rendered_options: dict) -> str:
if rendered_options.get("partition_by"):
if rendered_options.get("partition_by") or rendered_options.get("per_thread_output"):
globs = [write_location, "*"]
partition_by = str(rendered_options.get("partition_by"))
globs.extend(["*"] * len(partition_by.split(",")))
if rendered_options.get("partition_by"):
partition_by = str(rendered_options.get("partition_by"))
globs.extend(["*"] * len(partition_by.split(",")))
return ".".join(["/".join(globs), str(rendered_options.get("format", "parquet"))])
return write_location

Expand Down

0 comments on commit 0da066b

Please sign in to comment.