Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions models/marts/dim_products.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{{
config(
materialized='incremental',
unique_key='order_id',
incremental_strategy='merge'
)
}}

with products as (

select * from {{ ref('stg_products') }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [select_star] SELECT * detected — explicitly list columns for clarity and performance

💡 Suggestion: Replace SELECT * with an explicit column list, e.g. SELECT id, name, status FROM ...

Expand Down Expand Up @@ -46,3 +54,7 @@ final as (
)

select * from final
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [select_star] SELECT * detected — explicitly list columns for clarity and performance

💡 Suggestion: Replace SELECT * with an explicit column list, e.g. SELECT id, name, status FROM ...


{% if is_incremental() %}
where revenue_date > (select max(revenue_date) from {{ this }})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [correlated_subquery] Possible correlated subquery in WHERE clause — consider rewriting as a JOIN for better performance

💡 Suggestion: Rewrite the correlated subquery as a JOIN or use a CTE to materialize the subquery result

{% endif %}
Loading