Comments (7)
As I struggled a bit to understand the way with statements work, here is a full example
SELECT * FROM (
with t1 as (select * FROM {{ref('other_dbt_view_or_table')}})
SELECT * FROM t1
)
from dbt-athena.
Thanks, interesting find!
It would be good to find out in what cases Athena does support CTEs. Maybe we need to wrap the inner query in a select * from(with...
? I am currently not on a computer, so I can not check.
from dbt-athena.
Ah, interesting, yes wrapping in the SELECT statement gets around the problem.
I'm generally using CTE's in (materialized) views in Athena with all CTE's preceding the final SELECT statement.
from dbt-athena.
Yeah, that makes sense, that's also how I use dbt generally.
We could likely change the adapter to wrap all queries in a select to workaround this issue.
from dbt-athena.
Thanks @AndresNamm !! That worked great!
from dbt-athena.
Maybe something that should be added to the docs while we don't workaround that Athena doesn't support it in a create table/view as statement?
from dbt-athena.
I believe we should just change the create_view_as and create_table_as macro's to generate a view starting with SELECT *
.
Original macro's are here:
Help welcome!
from dbt-athena.
Related Issues (13)
- Error while generating docs HOT 2
- Catalog does not exist HOT 3
- Upgrade to 0.15.3
- Add MyPy to CI
- Publish to PyPI HOT 1
- Incremental models HOT 1
- Upgrade to dbt 0.16
- DBT Seeds "No location was specified for table" HOT 1
- dbt docs generate fails with "Column 'table_schema' is ambiguous" HOT 4
- is this compatible with dbt 0.17.2 ? HOT 1
- dbt-athena doesn't handle HIVE_CANNOT_OPEN_SPLIT: File does not exist: errors gracefully HOT 2
- Status of the adapter HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-athena.