Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External materialization fails if table is empty #503

Open
guenp opened this issue Feb 3, 2025 · 0 comments
Open

External materialization fails if table is empty #503

guenp opened this issue Feb 3, 2025 · 0 comments
Assignees

Comments

@guenp
Copy link
Collaborator

guenp commented Feb 3, 2025

When using an external materializations (external.sql), one of the first steps is to write the table to an external file:

copy "memory"."foo"."table_json__dbt_tmp" to '/foo/bar/baz/table_json.json' (format json)

if the model is empty, this should create an empty file.

this works locally, however, when using a remote location on s3://... the SQL command fails silently, and a remote file is not created.
This causes for the next step in the macro (creating a view) to fail with a 404 error:

Runtime Error in model table_json (models/table_json.sql)
HTTP Error: Unable to connect to URL "https:/my_bucket/table_json.json": 404 (Not Found)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant