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

Incremental macros missing from packaged dbt-spark==0.19.0 #152

Closed
highfly22 opened this issue Feb 26, 2021 · 3 comments · Fixed by #151
Closed

Incremental macros missing from packaged dbt-spark==0.19.0 #152

highfly22 opened this issue Feb 26, 2021 · 3 comments · Fixed by #151
Labels
bug Something isn't working

Comments

@highfly22
Copy link

highfly22 commented Feb 26, 2021

Describe the bug

When a incremental model is running, the following error is reported

  Runtime Error
    Database Error
      org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'my_table__dbt_tmp' not found in database 'FooSchema';

For example, the schema is configured as "FooSchema". The temporary view is created as "my_table__dbt_tmp". The describe command tries to find 'FooSchema.my_table__dbt_tmp', which doesn't exists.

    create temporary view my_table__dbt_tmp as
    
    describe extended FooSchema.my_table__dbt_tmp

Steps To Reproduce

  1. configure spark profile
  2. create a incremental model
  3. invoke dbt run -m my_table twice

Expected behavior

No error is reported.

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

The output of dbt --version:

installed version: 0.19.0
   latest version: 0.19.0

Up to date!

Plugins:
  - spark: 0.19.0
  - postgres: 0.19.0
  - redshift: 0.19.0
  - snowflake: 0.19.0
  - bigquery: 0.19.0

Python 3.6.3

The operating system you're using:

The output of python --version:
Python 3.6.3

Additional context

    dev:
      type: spark
      method: thrift
      schema: FooSchema
      host: localhost
      port: 10000
      user: Foo
      auth: NONE

Thrift server is created by spark 2.4.7

@highfly22 highfly22 added bug Something isn't working triage labels Feb 26, 2021
@jtcohen6
Copy link
Contributor

jtcohen6 commented Feb 26, 2021

Hey @highfly22, thanks for the issue, I was just about to open this!

This is actually a problem with the distribution of dbt-spark==0.19.0 that we're hoping to fix very soon. In particular, this line in package_data:
https://github.com/fishtown-analytics/dbt-spark/blob/46b2881656ff9028d8850a9f3bda23b51986088f/setup.py#L59
Failed to glob for the three files in include/spark/macros/materializations/incremental/*.sql.

Because those files are missing from the packaged plugin, dbt instead falls back to the default incremental materialization, which doesn't work on Spark and raises the error you're seeing here.

We're going to fix this (#151) and ship dbt-spark==v0.19.0.1 ASAP. In the meantime, you can either:

  • Downgrade to dbt-spark==0.18.1
  • Copy the three incremental macro files into your own project's macros/ folder, as dbt will prioritize your versions

@jtcohen6 jtcohen6 removed the triage label Feb 26, 2021
@jtcohen6 jtcohen6 changed the title Temporary view is created in wrong schema while run a incremental model Incremental macros missing from packaged dbt-spark==0.19.0 Feb 26, 2021
@kwigley kwigley linked a pull request Feb 26, 2021 that will close this issue
4 tasks
@kwigley
Copy link

kwigley commented Feb 26, 2021

closed by #151!

@kwigley kwigley closed this as completed Feb 26, 2021
@kwigley
Copy link

kwigley commented Feb 26, 2021

Fix is included in 0.19.0.1 which is now available on PyPi

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

Successfully merging a pull request may close this issue.

3 participants