SQL Compilation Errors not propagated as ERROR #1823
Labels
bug
Used to mark issues with provider's incorrect behavior
category:other
resource:table
Issue connected to the snowflake_table resource
Provider Version
v0.62.0
Terraform Version
v1.4.6 (Deployed through CDKTF @latest - tested manually as well)
Describe the bug
SQL compilation errors are returned as DEBUG messages and not relayed to a terraform deploy unless TF_LOG=TRACE/DEBUG is set
Errors encountered are as follows:
Bad data type for column.
Table already exists.
Expected behavior
Terraform error with deploy is thrown, proper snowflake errors are propagated through without the need for TF_LOG=TRACE/DEBUG being set.
Code samples and commands
Please add code examples and commands that were run to cause the problem.
-------------------------- DEBUG MESSAGE --------------------------
2023/05/22 11:15:36 [DEBUG] sql-conn-exec [query CREATE TABLE "#######"."#######"."#######" ("#######" NUMBER(38,0) COMMENT '', "#######" NUMBER(38,0) COMMENT '', "#######" VARCHAR(50) COMMENT '', "#######" VARCHAR(150) COMMENT '', "#######" TIMESTAMP_NTZ(9) COMMENT '', "#######" TIMESTAMP_NTZ(9) COMMENT '', "#######" VARCHAR(50) COMMENT '', "#######" VARCHAR(50) COMMENT '', "#######" NUMBER(38,0) COMMENT '', "#######" NUMBER(38,0) COMMENT '', "#######" NUMBER(38,0) COMMENT '', "#######" VARCHAR(1) COMMENT '', "#######" TIMESTAMP_NTZ(9) NOT NULL COMMENT '', "#######" NUMBER(38,0) COMMENT '', "#######" VARCHAR(500) COMMENT '', "#######" TIMESTAMP_NTZ(9) COMMENT '', "#######" TIMESTAMP_NTZ(9) COMMENT '', "#######" VARCHAR(50) COMMENT '', "#######" VARCHAR(100) NOT NULL COMMENT '', "#######" VARCHAR(500) NOT NULL COMMENT '', "#######" VARCHAR(500) NOT NULL COMMENT '', "#######" VARCHAR(500) NOT NULL COMMENT '', "#######" NUMBER(20,0) NOT NULL COMMENT '', "#######" VARCHAR(500) NOT NULL COMMENT '', "#######" TIMESTAMP_NTZ(9) NOT NULL COMMENT '', "#######" TIMESTAMP_NTZ(9) NOT NULL COMMENT '', "#######" TIMESTAMP_NTZ(9) NOT NULL COMMENT '', "#######" NUMBER(20,0) NOT NULL COMMENT '', "#######" NUMBER(20,0) NOT NULL COMMENT '') COMMENT = '####### FROM #######.#######.####### - ' DATA_RETENTION_TIME_IN_DAYS = 1 CHANGE_TRACKING = true err 002002 (42710): SQL compilation error: Object '#######.#######.#######' already exists. duration 283.504778ms args {}]: timestamp=2023-05-22T11:15:36.400Z
-------------------------- END DEBUG MESSAGE --------------------------
-------------------------- ERROR WITHOUT TF_LOG=TRACE/DEBUG --------------------------
Error: error creating table #######
with module.snowflake_table_group.module.snowflake_table["#######"].snowflake_table.main,
on assets/local-module-snowflake_table_group/330C88A764715C45B6D0937FBCE47A66/snowflake_table/main_table.tf line 1, in resource "snowflake_table" "main":
1: resource "snowflake_table" "main" {
-------------------------- END ERROR WITHOUT TF_LOG=TRACE/DEBUG --------------------------
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: