-
Notifications
You must be signed in to change notification settings - Fork 361
Open
Labels
BugSomething isn't workingSomething isn't working
Description
When the second argument in an @EACH() function call matches a column in the node, it seems to be ignored.
SQLMesh definition
SELECT
organization_id,
@EACH(
@product_families_simple,
product -> (
MIN(CASE WHEN product = @product AND rownum = 4 THEN reference_date END)
) AS @{product}_low_engagement_date
),Compiled SQL
SELECT
`_pql_qualifying_days`.`organization_id` AS `organization_id`,
MIN(
CASE
WHEN `_pql_qualifying_days`.`rownum` = 4
THEN `_pql_qualifying_days`.`reference_date`
END
) AS `feeds_low_engagement_date`,When adding a prefix, it compiles correctly.
SQLMesh definition
SELECT
organization_id,
@EACH(
@product_families_simple,
_product -> (
MIN(CASE WHEN (product = @_product AND rownum = 4) THEN reference_date END)
) AS @{product}_low_engagement_date
),Compiled SQL
SELECT
`_pql_qualifying_days`.`organization_id` AS `organization_id`,
MIN(
CASE
WHEN (
`_pql_qualifying_days`.`product` = 'feeds'
AND `_pql_qualifying_days`.`rownum` = 4
)
THEN `_pql_qualifying_days`.`reference_date`
END
) AS `feeds_low_engagement_date`,Using version 0.227.0.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working