Assigned
Status Update
Comments
va...@google.com <va...@google.com>
sa...@google.com <sa...@google.com> #2
Hello,
Thank you for reaching out to us with your request.
We have duly noted your feedback and will thoroughly validate it. While we cannot provide an estimated time of implementation or guarantee the fulfillment of the issue, please be assured that your input is highly valued. Your feedback enables us to enhance our products and services.
We appreciate your continued trust and support in improving our Google Cloud Platform products. In case you want to report a new issue, Please do not hesitate to create a new issue on the
Once again, we sincerely appreciate your valuable feedback; Thank you for your understanding and collaboration.
Description
ARRAY_AGG(STRUCT(repositories.hostname AS hostname, repositories.repository AS repository, image.image_digest AS digest)) AS image_repositories,
ARRAY_AGG(DISTINCT purls.purl) AS variations,
--ARRAY_AGG(DISTINCT purls.purl) AS variations,
FROM stream_images AS image
INNER JOIN stream_image_purls ON image.stream_image_id = stream_image_purls.stream_image_id
INNER JOIN purls ON stream_image_purls.purl_id = purls.purl_id
INNER JOIN image_repositories ON image.image_id = image_repositories.image_id
INNER JOIN repositories ON image_repositories.repository_id = repositories.repository_id
WHERE
image.team_id = 'team-id' AND
image.image_digest IN UNNEST([
'sha256:example',
'sha256:etc'
])
GROUP BY purls.advisory_url_id;
This query runs successfully. However uncommenting the 3rd ARRAY_AGG causes the first ARRAY_AGG to break with the following error:
`Unsupported query shape: This query returns a STRUCT value constructed by a scalar subquery or struct construction syntax. Spanner does not yet support returning STRUCT except as arrays-of-structs. Rephrase your query to produce the struct value with an array subquery: ARRAY(SELECT AS STRUCT expr ...) or flatten the structs fields into the result.`
It is not specific that ARRAY_AGG - uncommenting the 3rd one and commenting the 2nd also works! 4 ARRAY_AGGS also doesn't work.
Interestingly spanner studio detects this before the query is even run.
The spanner emulator works as expected.