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

[Bug]: Materialize as table in a Dremio space sub folder fails #194

Open
1 task done
maxfirman opened this issue Jul 3, 2023 · 2 comments
Open
1 task done

[Bug]: Materialize as table in a Dremio space sub folder fails #194

maxfirman opened this issue Jul 3, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@maxfirman
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If you define a model materialisation strategy to materialized='table' then it creates the table in the object_storage_source at the object_storage_path and a corresponding view in the dremio_space. The creation of the view fails if the model's schema is configured as a subfolder and that subfolder does not already exist.

It is possible to work around this bug by creating another dummy model in the same schema with materialisation strategy materialized='view'.

Expected Behavior

The view created by the materialized='table' strategy should create the subfolder if it does not exist already.

Steps To Reproduce

Create a simple model to materialize as a table in a subfolder:

{{ config(materialized='table', schema='foo.bar') }}
select 1 as a

Execute

dbt run

Observe error:

10:48:03    ERROR: NamespaceNotFoundException: one or more elements on the path are not found in namespace: "<dremio_space>".foo.bar.baz

Environment

- OS: Ubuntu
- dbt-dremio: 1.5.0
- Dremio Software: 24.0.2

Relevant log output

No response

@maxfirman maxfirman added the bug Something isn't working label Jul 3, 2023
@mxmarg
Copy link
Contributor

mxmarg commented Jul 7, 2023

I can confirm that this bug exists and I have used the same workaround of creating a simple "init" view in the same space folder before materialising the table

@mxmarg
Copy link
Contributor

mxmarg commented Feb 23, 2024

As described by @fabrice-etanchaud in his comment (#192 (comment)), another workaround is to set the dbt-dremio connector's twin_strategy to either allow or prevent, instead of the default clone. This will stop dbt from attempting to create an additional view on top of the created table.

Example:

{{ config(
    twin_strategy="allow",
    materialized="table"
) }}
SELECT 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants