Skip to content

Conversation

@VaggelisD
Copy link
Collaborator

Fixes #6392

Canonicalizing STRING_AGG with a string literal comma separator is not correct in case the expression is of BYTES type:

bq> SELECT STRING_AGG(a) FROM UNNEST([b'foo', b'bar', b'baz']) AS a
Zm9vLGJhcixiYXo= -- BASE64 decoding: foo,bar,baz

bq> SELECT STRING_AGG(a, ',') FROM UNNEST([b'foo', b'bar', b'baz']) AS a
Zm9vLGJhcixiYXo= -- BASE64 decoding: foo,bar,baz

No matching signature for aggregate function STRING_AGG Argument types: BYTES, STRING

Docs

BQ STRING_AGG

@VaggelisD VaggelisD merged commit 21d3859 into main Nov 24, 2025
8 checks passed
@VaggelisD VaggelisD deleted the vaggelisd/bq_string_agg branch November 24, 2025 14:29
@erindru
Copy link
Collaborator

erindru commented Nov 24, 2025

/integration-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bigquery] SPLIT(BYTE) is incorrectly roundtripped

4 participants