Is there an existing issue for this?
Current Behavior
using the --empty option seems to injects a table alias into the model code, this makes the sql broken if you already have a table alias for the ref() or source() statement.
Expected Behavior
dbt-dremio should compile correct sql (omitting the generated "alias"):
model stg_test2:
select * from {{ref('stg_test1')}} as boom
command:
dbt run -s stg_test2 --empty
compiled sql:
select * from (select * from "space"."trooper"."stg_test1" where false limit 0) as boom
Steps To Reproduce
model stg_test2:
select * from {{ref('stg_test1')}} as boom
command:
dbt run -s stg_test2 --empty
compiled sql:
select * from (select * from "space"."trooper"."stg_test1" where false limit 0) _dbt_limit_subq_stg_test1 as boom
dremio error: Encountered "as" at line 1, column 107.
the _dbt_limit_subq_stg_test1 alias should not be there.
Environment
os: macos sequoia 15.6.1
Core:
- installed: 1.10.10
Plugins:
- dremio: 1.9.0 - Up to date!
Relevant log output
11:53:04 Failure in model stg_test2 (models/staging/stg_test2.sql)
11:53:04 Runtime Error in model stg_test2 (models/staging/stg_test2.sql)
ERROR: Encountered "as" at line 6, column 159.
Was expecting one of:
<EOF>
"," ...
"ORDER" ...
"LIMIT" ...
"OFFSET" ...
"FETCH" ...
";" ...
"NATURAL" ...
"JOIN" ...
"INNER" ...
"LEFT" ...
"RIGHT" ...
"FULL" ...
"CROSS" ...
"OUTER" ...
"(" ...
"TABLESAMPLE" ...
"WHERE" ...
"GROUP" ...
"HAVING" ...
"QUALIFY" ...
"WINDOW" ...
"UNION" ...
"INTERSECT" ...
"EXCEPT" ...
"MINUS" ...
11:53:04
11:53:04 compiled code at target/compiled/template/models/staging/stg_test2.sql
11:53:04
11:53:04 Done. PASS=1 WARN=0 ERROR=1 SKIP=0 NO-OP=0 TOTAL=2
Is there an existing issue for this?
Current Behavior
using the --empty option seems to injects a table alias into the model code, this makes the sql broken if you already have a table alias for the ref() or source() statement.
Expected Behavior
dbt-dremio should compile correct sql (omitting the generated "alias"):
model stg_test2:
select * from {{ref('stg_test1')}} as boomcommand:
dbt run -s stg_test2 --emptycompiled sql:
select * from (select * from "space"."trooper"."stg_test1" where false limit 0) as boomSteps To Reproduce
model stg_test2:
select * from {{ref('stg_test1')}} as boomcommand:
dbt run -s stg_test2 --emptycompiled sql:
select * from (select * from "space"."trooper"."stg_test1" where false limit 0) _dbt_limit_subq_stg_test1 as boomdremio error: Encountered "as" at line 1, column 107.
the _dbt_limit_subq_stg_test1 alias should not be there.
Environment
Relevant log output