fivetran / dbt_jira

Data models for Fivetran's Jira connector built using dbt.
https://fivetran.github.io/dbt_jira/
Apache License 2.0
8 stars 13 forks source link

Run full and get the error message: SQL compilation error #106

Closed RivkiHofman closed 1 year ago

RivkiHofman commented 1 year ago

Is there an existing issue for this?

Describe the issue

Hi

I use with jira package version 0.13.0:

packages:

When I run command "dbt run", the running finished successfully, but when I run command "dbt run --full-refresh" I get the error message: "SQL compilation error: Object found is of type 'VIEW', not specified type 'TABLE'" The error is from table: jiradaily_issue_field_history. The table is created, but in the end of script, after table created, there is a script: "drop table if exists BIDEVDB.dwh_actimize_jira.jira__daily_issue_field_historydbt_tmp" And from this script there is the full error message:

" drop table if exists BIDEVDB.dwh_actimize_jira.jiradaily_issue_field_historydbt_tmp cascade 16:15:28 Snowflake adapter: Snowflake query id: 01ad678f-0604-9d33-0011-9f07023e562e 16:15:28 Snowflake adapter: Snowflake error: 002203 (02000): SQL compilation error: Object found is of type 'VIEW', not specified type 'TABLE'. 16:15:28 Snowflake adapter: Error running SQL: macro drop_relation 16:15:28 Snowflake adapter: Rolling back transaction. 16:15:28 Timing info for model.jira.jiradaily_issue_field_history (execute): 16:10:40.733197 => 16:15:28.287234 16:15:28 On model.jira.jiradaily_issue_field_history: Close 16:15:28 Database Error in model jiradaily_issue_field_history (models/jira__daily_issue_field_history.sql) 002203 (02000): SQL compilation error: Object found is of type 'VIEW', not specified type 'TABLE'. compiled code at target/run/jira/models/jiradaily_issue_field_history.sql " Can you check why? Than a lot

Relevant error log or model output

drop table if exists BIDEVDB.dwh_actimize_jira.jira__daily_issue_field_history__dbt_tmp cascade
Snowflake adapter: Snowflake query id: 01ad678f-0604-9d33-0011-9f07023e562e
Snowflake adapter: Snowflake error: 002203 (02000): SQL compilation error: Object found is of type 'VIEW', not specified type 'TABLE'.
Snowflake adapter: Error running SQL: macro drop_relation
Snowflake adapter: Rolling back transaction.
Timing info for model.jira.jira__daily_issue_field_history (execute): 16:10:40.733197 => 16:15:28.287234
On model.jira.jira__daily_issue_field_history: Close
Database Error in model jira__daily_issue_field_history (models/jira__daily_issue_field_history.sql)
  002203 (02000): SQL compilation error: Object found is of type 'VIEW', not specified type 'TABLE'.
  compiled Code at target/run/jira/models/jira__daily_issue_field_history.sql

Expected behavior

In running of full refresh, this script unnecessary, because there is no a temporary table:

create or replace transient table BIDEVDB.dwh_actimize_jira.jira__daily_issue_field_history copy grants as...

A temporary table exists only in incremental running.

dbt Project configurations

Name your project! Project names should contain only lowercase characters

and underscores. A good package name should reflect your organization's

name or the intended use of these models

name: 'actimize_project' version: '1.0.0' config-version: 2

vars:

jira_issue_history_buffer: 12

issue_field_history_columns: ['acceptance owner','acceptance criteria','action completed date','actual delivery date','actual pi','aggregated done story points','aggregated remaining story points', 'aggregated story points','aha url','analysis status','append release notes','artifact id','artifact version','artifactory link','assignment type','automated', 'backlog rank','begin date','bug origin','candidate for automation','capitalize','clone','closed','code freeze date','commitment level','commitment type','cs task id', 'cs task owner','customer','customer facing guides - docenter','customer facing guides - sandbox','customer impact','customer priority','documentation completed', 'documentation link','documentation required','draft document url','end date','environment name','epic color','epic description','epic link','epic name','epic planned pi', 'epic status','epic story points','epic type','escape analysis category','eta given date','expected next update','external issue id','field readiness notes','fix notes', 'flag - comment added','flag - status changed','found by automation','found on build','fr status','functionality','functionality required version','gdpr files location', 'git link','guide names','guide page\section','guide version','high level estimate','impact','installation steps','instance sp','instance version','internal facing guides - docenter', 'internal facing guides - sandbox','investigation steps','issue color','justification','last status change','last updated by wiser','limitation reason','limited release', 'link to case/sr','link to cs task','link to task','milestone','old issue key','origin','original estimate','originated in version','os type','overall cst priority', 'packaging status','planned date','planned pi','planned release','possible root cause','priority customer','product','project type','quality reason','quality sub-reason', 'rank','regression','release highlights','release notes','release on scope','release on time','release type','reopen counter','requested date','requested pi','requested release', 'required actions','requirement category','resolution name','resolution type','resolved date','risk score','rn description','rn fix','rn summary','rollback instructions', 'root cause analysis','root cause for no automation','rtc id','run on build','sdc link','severity','shared attachment folder','short description','shortcut opportunity', 'shortcut opportunity description','solution required version','start date','steps to reproduce','story description','story points','support quality of escalation','svn commits', 't-shirt size','task classification','task id','team name','technical availability date','technical description \ limitation','tenant id','test coverage type','url to rtc', 'url to tracker','version','virus scan status','wa bug created','wiser attachments','wiser case / sr owner','wiser case/sr#','wiser parent creation date','wiser sysid','wiser task cancellation reason']

jira_database: fivetran_actimize jira_schema: jira_cloud_prod

models: +copy_grants: true jira: +schema: dwh_actimize_jira jira_source:
+schema: dwh_actimize_jira

Package versions

packages:

What database are you using dbt with?

snowflake

dbt Version

dbt Version: 1.5 (latest)

Additional Context

No response

Are you willing to open a PR to help address this issue?

RivkiHofman commented 1 year ago

Hi

I continued to check the problem, and found in our database a view with same name, I deleted the view and process finished successfully.

So you can delete this issue.

Thanks.