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

[ADAP-1019] [Bug] Table already exists, you need to drop it first in incremental models #940

Open
2 tasks done
lsabreu96 opened this issue Nov 8, 2023 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working iceberg Related to the iceberg file format Stale triage

Comments

@lsabreu96
Copy link

Is this a new bug in dbt-spark?

  • I believe this is a new bug in dbt-spark
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Whenever running a incremental model after a first run, dbt spark using hudi as file_format states that the table already exists and should be dropped.

Expected Behavior

Any run after the should proceed as the first

Steps To Reproduce

  1. Using dbt-spark=1.5.2
  2. Start a Kyuubi server with Hudi enabled
  3. Ran the sample model twice
{{
    config(
        materialized='incremental',
        incremental_strategy='merge',
        unique_key='prim_key',
        file_format='hudi',
        location_root=<s3-path>'
    )
}}

select 1 as prim_key

Relevant log output

org.apache.kyuubi.KyuubiSQLException: org.apache.kyuubi.KyuubiSQLException: Error operating ExecuteStatement: org.apache.spark.sql.AnalysisException: Table teste_dbt_dw_spark.kyuubi_incremental_hudi already exists. You need to drop it first.

Environment

- OS: Ubuntu 20.04
- Python: 3.8.10
- dbt-core: 1.5.8
- dbt-spark:1.5.2

Additional Context

I'm running Kyuubi as I wasn't able to use thrift as per the docs on EMR.

Also followed some examples here, but didn't manage to get it working

@lsabreu96 lsabreu96 added bug Something isn't working triage labels Nov 8, 2023
@github-actions github-actions bot changed the title [Bug] Table already exists, you need to drop it first in incremental models [ADAP-1019] [Bug] Table already exists, you need to drop it first in incremental models Nov 8, 2023
@lsabreu96
Copy link
Author

It seems to be a problem when the adapter can't read all tables in the catalog.
I had some Iceberg tables set in the same catalog and some errors were popping up regarding those.

After deleting the Iceberg tables, the adapter worked as expected

@dbeatty10 dbeatty10 added the iceberg Related to the iceberg file format label Feb 7, 2024
Copy link
Contributor

github-actions bot commented Aug 6, 2024

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 6, 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 iceberg Related to the iceberg file format Stale triage
Projects
None yet
Development

No branches or pull requests

2 participants