-
Notifications
You must be signed in to change notification settings - Fork 28
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
[Bug]: "Can not create a folder inside a [SOURCE]" when writing table into object storage #195
Comments
interested as well, but if you don't mind @mxmarg I have a question, I have been trying to use the materialized=table configuraiton and the table is created in dremio as expected, in the location where it is supposed to but the dbt run command never finishes, it seems that it hangs, have you ever experienced this? |
I have not experienced this particular behaviour, no. Is it reproducible? If yes, you could probably open a separate bug. |
I hope someone can clean these threads, but to me it sounds like your issue is this one: #176 |
Hi all, yes, the adapter should not try to create schemas in writable sources, as dremio will do it itself. It seems to be already some watchdogs in the code :
But at that stage one cannot guess if the database is a writable source or a space. Maybe the simplest way is to ignore this exception in the _create_space and _create_forders routines ? |
After having tested the new dbt-dremio release 1.5.1, I was no longer able to reproduce this error |
Sorry for the confusion, but I must have missed something in the repro, as the bug is still valid. As per @fabrice-etanchaud 's suggestion, the command works, if we add additional error handling like the following:
|
… table (#219) ### Summary See linked issue ### Description The existing code logic verifies whether the database property matches the object storage source. If it does, the code should avoid attempting schema creation via the REST API. However, when the object storage source is provided via a configuration block within a model, this condition fails because it only reads the object_storage_source value from the profiles.yml file. By modifying the condition to check the materialization type, the logic becomes more robust. This change ensures that schema creation is only attempted when the relation is a view. ### Test Results Ran all tests ### Changelog - [x] Added a summary of what this PR accomplishes to CHANGELOG.md ### Related Issue #195
Is there an existing issue for this?
Current Behavior
When attempting to create a materialized table in a not yet existing folder, Dremio dbt throws the following error message:
dbt.adapters.dremio.api.rest.error.DremioBadRequestException: Bad request:: (400 Client Error: Bad Request for url: http://<DREMIO_ENDPOINT>/api/v3/catalog): ({"errorMessage":"Can not create a folder inside a [SOURCE].","moreInfo":""})
The current workaround is to create the data source folder outside of dbt.
Expected Behavior
Since Dremio is able to write Iceberg tables while creating new directories, this error should not occur.
Likely, Dremio is using the catalog REST API method to create a folder in the Semantic Layer, which is throws an error, since it is not possible to create Semantic Layer folders on an object storage in Dremio.
Steps To Reproduce
{{ config(
materialized="table",
database="DEBUG_SPACE",
schema="Debug",
object_storage_source="source_name",
object_storage_path="container_name.NOT_YET_EXISTING_FOLDER"
) }}
SELECT 1
Environment
Relevant log output
The text was updated successfully, but these errors were encountered: