forked from mozilla/moz-sql-parser
-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Error when use function STRING_AGG with IGNORE NULLS
Query sample:
WITH agg_phones AS (
SELECT
m.stone_code,
ct.name AS type,
c.contact_name AS name,
ARRAY_AGG(DISTINCT email IGNORE NULLS) AS email,
ARRAY_AGG(DISTINCT c.mobile_phone_number IGNORE NULLS) AS m_phone,
ARRAY_AGG(DISTINCT c.phone_number IGNORE NULLS) AS phone,
MAX(c.last_modified_date) as last_modified_date
FROM
...
)
SELECT
stone_code,
type,
name,
email,
ARRAY(SELECT DISTINCT phones
FROM
UNNEST(ARRAY_CONCAT(m_phone, phone)) AS phones
) AS phones_array,
last_modified_date,
CURRENT_TIMESTAMP AS processed_at
FROM
agg_phones
How to reproduce?
Metadata
Metadata
Assignees
Labels
No labels