Skip to content

ARRAY_AGG of STRUCT types in GROUP BY queries issue V2 #5445

@mChlopek

Description

@mChlopek

Related to closed issue :
#5262
Has this been released? I can't find these changes in the releases and still have issues using latest version

The issue appears to be that SQLMesh is incorrectly parsing `ARRAY_AGG(STRUCT(...))
Column custom_fields contains an aggregation function, which is not allowed in GROUP BY at [1:695]

The commented out line of code works fine in bq sql dbt.
I had to create a new structure to make it work (but it shouldn't work that way).

SELECT
task_id
--, ARRAY_AGG(custom_field) AS custom_fields this line should work as do with dbt
, ARRAY_AGG(
STRUCT(
custom_field.id,
custom_field.type,
custom_field.name,
custom_field.required,
custom_field.value,
custom_field.reference
)
) AS custom_fields
FROM custom_fields
GROUP BY task_id
Thanks in advance for help!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions