sqlfluff/sqlfluff

Last select statement in a file should be select * from

Geschlossen

#546 geöffnet am 11.11.2020

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (539 Forks)batch import
dbt-coding-conventionsgood first issuenew rule

Repository-Metriken

Stars
 (6.572 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 2T 1h) (86 gemergte PRs in 30 T)

Beschreibung

https://github.com/fishtown-analytics/corp/blob/master/dbt_coding_conventions.md#example-sql

Also from 'Why the Fishtown SQL style guide uses so many CTEs':

What’s the deal with the final CTE, isn’t that redundant? By now, hopefully you’ve bought into the fact that CTEs don’t affect query performance. But what’s with the last CTE, it is just so uneccesary!

I thought so too when I started at Fishtown and had to adopt this style guide. Having this last CTE makes debugging so much easier. If something weird is happening in your query, it’s much easier to replace:

select * from final

with

select * from customer_orders

Contributor Guide