malloy icon indicating copy to clipboard operation
malloy copied to clipboard

Invalid WHERE clause when nesting inside a filtered source

Open whscullin opened this issue 2 years ago • 1 comments

That's my takeaway, anyway - the following

source: state_facts is table('state_facts.parquet') {
    where: state !~ r'MN'

    query: most_popular is {
        project: popular_name
    }

    query: popular_dashboard is {
        nest:
            most_popular
    }
}

Produces:

Parser Error: syntax error at or near ")"
LINE 10:   AND ((group_set NOT IN () OR (group_set IN () AND COALESCE(NOT(REGEXP_MATCHES(state_facts."state", 'MN')),FALSE))))
  GROUP BY 1
)
SELECT
  MAX(CASE WHEN group_set=0 THEN most_popular__0 END) as "most_popular"
FROM __stage0
...
                                   ^

whscullin avatar Jul 28 '22 23:07 whscullin

Also ran into the same issue where group_set filters are empty: group_set NOT IN() OR (group_set IN () AND ... seems to work if I modify my filter to include those group_set NOT IN(1) OR (group_set IN (0) AND...

gmaden avatar Oct 12 '23 00:10 gmaden