Fix(bigquery)!: map native SHA512 to SHA2Digest, mirroring SHA256 [CLAUDE]#7832
Merged
Merged
Conversation
georgesittas
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up agreed in #7824: the bigquery parser mapped
SHA256toexp.SHA2DigestbutSHA512toexp.SHA2, while BigQuery returns BYTES for both.Changes:
SHA512toexp.SHA2Digest, mirroring theSHA256line above it.exp.SHA2Digestthrough a dialect-specific function that encodes text-typed arguments (SHA512(TO_UTF8(x))), since the native digests take VARBINARY. Same convention assha2_sqlafter the Fix(presto)!: preserve SHA256/SHA512 digest semantics, render SHA2 as hex string [CLAUDE] #7824 review:is_typeonly, type inference is assumed to have run separately. Unsupported lengths raise the usual warning.exp.SHA2Digeston main, so BYTES semantics survive there with no change.Test updates in test_bigquery.py:
SELECT SHA512(TO_UTF8('foo'))on presto: BigQuery's SHA512 returns BYTES, so digest-to-digest is the value-preserving translation rather than the hex-string form.SHA512(x)for the same reason; spark2/clickhouse/bigquery entries are unchanged.DuckDB renders 512-bit digests as
UNHEX(SHA256(x))behind the existing "only supports SHA256" unsupported-warning; that fallback predates this change and is left as is.Full dialect suite: 742 passed, 11174 subtests.