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

Relation name 'xyz__dbt_incremental_period0_tmp' is longer than 63 characters #35

Open
1 of 5 tasks
moltar opened this issue Aug 1, 2022 · 1 comment
Open
1 of 5 tasks
Labels
bug Something isn't working good first issue Good for newcomers insert_by_period relating to the insert by period materializaiton

Comments

@moltar
Copy link

moltar commented Aug 1, 2022

Describe the bug

We have a model with a long name.

When we use materialized: insert_by_period and the suffix is appended by dbt-utils, the resulting model name is too long.

Steps to reproduce

Use a model name that is 62 characters.

Expected results

Not result in an error and have the ability to override the name.

Actual results

An error is thrown:

20:41:47    Relation name 'xyz__dbt_incremental_period0_tmp' is longer than 63 characters

Screenshots and log output

N/A

System information

The contents of your packages.yml file:

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

Core:
  - installed: 1.2.0
  - latest:    1.2.0 - Up to date!

Plugins:
  - postgres: 1.2.0 - Up to date!

Additional context

The fix for PostgreSQL was implemented here: dbt-labs/dbt-core#4921

I think changing the code to:

{%- set tmp_identifier = make_temp_relation(model['name'], '__dbt_incremental_period' ~ i ~ '_tmp') -%}

Should solve the problem.

Are you interested in contributing the fix?

@moltar moltar added the bug Something isn't working label Aug 1, 2022
@joellabes
Copy link
Contributor

joellabes commented Aug 2, 2022

Hi @moltar! We're in the process of extracting the insert_by_period materialization from this project and moving it to the experiments repo, to better reflect its level of maturity.

Once that move is complete, we'd welcome a PR to incorporate this fix!

@joellabes joellabes added the good first issue Good for newcomers label Aug 2, 2022
@joellabes joellabes transferred this issue from dbt-labs/dbt-utils Oct 17, 2022
@dataders dataders added the insert_by_period relating to the insert by period materializaiton label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers insert_by_period relating to the insert by period materializaiton
Projects
None yet
Development

No branches or pull requests

3 participants