You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
, services_by_marketing_contact_id AS (
SELECTmarketing_contact_order.dim_marketing_contact_idAS dim_marketing_contact_id,
COUNT(*) AS pql_nbr_integrations_installed,
ARRAY_AGG(DISTINCT services.service_type) WITHIN GROUP (ORDER BYservices.service_type) AS pql_integrations_installed
FROM services
LEFT JOIN project
ONservices.project_id=project.dim_project_idLEFT JOIN marketing_contact_order
ONmarketing_contact_order.dim_namespace_id=project.dim_namespace_idGROUP BY1
), users_role_by_marketing_contact_id AS (
SELECTmarketing_contact_order.dim_marketing_contact_id,
ARRAY_AGG(DISTINCT marketing_contact.job_title) WITHIN GROUP (ORDER BYmarketing_contact.job_title) AS pql_namespace_creator_job_description
FROM marketing_contact_order
...
Expected behavior
services_by_marketing_contact_id as (
selectmarketing_contact_order.dim_marketing_contact_idas dim_marketing_contact_id,
count(*) as pql_nbr_integrations_installed,
array_agg(distinct services.service_type) within group (
order byservices.service_type
) as pql_integrations_installed
from services
left join project onservices.project_id=project.dim_project_idleft join
marketing_contact_order
onmarketing_contact_order.dim_namespace_id=project.dim_namespace_idgroup by1
),
users_role_by_marketing_contact_id as (
selectmarketing_contact_order.dim_marketing_contact_id,
array_agg(distinct marketing_contact.job_title) within group (
order bymarketing_contact.job_title
) as pql_namespace_creator_job_description
from marketing_contact_order
...
Actual behavior
services_by_marketing_contact_id as (
selectmarketing_contact_order.dim_marketing_contact_idas dim_marketing_contact_id,
count(*) as pql_nbr_integrations_installed,
array_agg(
distinct services.service_type) within group(order byservices.service_type
) as pql_integrations_installed
from services
left join project onservices.project_id=project.dim_project_idleft join
marketing_contact_order
onmarketing_contact_order.dim_namespace_id=project.dim_namespace_idgroup by1
),
users_role_by_marketing_contact_id as (
selectmarketing_contact_order.dim_marketing_contact_id,
array_agg(
distinct marketing_contact.job_title
) within group(order bymarketing_contact.job_title
) as pql_namespace_creator_job_description
from marketing_contact_order
...
Additional context
What is the output of sqlfmt --version?
The text was updated successfully, but these errors were encountered:
Describe the bug
add support for the
within group
keyword, which seems analagous toover
, e.g.,array_agg(distinct my_field) within group (order by another_field)
This is necessary for proper formatting when this spills onto multiple lines, as below.
To Reproduce
from gitlab's project
Expected behavior
Actual behavior
Additional context
What is the output of
sqlfmt --version
?The text was updated successfully, but these errors were encountered: