aws-samples / dbt-glue

This repository contains the dbt-glue adapter
Apache License 2.0
101 stars 69 forks source link

drop table cascade : Syntax error at or near 'cascade' #389

Open olivd4400 opened 5 months ago

olivd4400 commented 5 months ago

Describe the bug

When using materialized='table' in models

{{ config(
    materialized='table',
    file_format='parquet',
    store_failures_as="table"
) }}

dbt run throws following error

== SQL ==
/* {"app": "dbt", "dbt_version": "1.7.15", "profile_name": "dbtODStest", "target_name": "dev", "node_id": "model.dbtODStest.table_test_ods"} */
drop view if exists dbt_demo.table_test_ods cascade

The generated SQL drop command seems to be incorrect since "cascade" keyword is not supported https://docs.aws.amazon.com/athena/latest/ug/drop-table.html

With materialized='incremental', everything works fine

System information

The output of dbt --version:

Core:
  - installed: 1.7.15
  - latest:    1.8.1  - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - postgres: 1.7.15 - Update available!
  - spark:    1.7.1  - Update available!
  - glue:     1.7.2  - Up to date!