chore(c/validation): add FloatCastTypeName quirk for CAST(... AS FLOAT)#4492
Closed
fornwall wants to merge 1 commit into
Closed
chore(c/validation): add FloatCastTypeName quirk for CAST(... AS FLOAT)#4492fornwall wants to merge 1 commit into
fornwall wants to merge 1 commit into
Conversation
a9f52f3 to
ce21e92
Compare
TestSqlQueryFloats and TestSqlSchemaFloats hardcoded SELECT CAST(1.5 AS FLOAT), whose FLOAT type name is not valid in every SQL dialect (GoogleSQL in BigQuery supports only FLOAT64 - Spanner also FLOAT32). Introduce a DriverQuirks::FloatCastTypeName() quirk defaulting to FLOAT and build the cast SQL from it, so existing drivers run byte-identical SQL while other dialects can override the type name. The tests assert only the returned Arrow type and value (1.5), which are unaffected. Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
ce21e92 to
010cbf3
Compare
lidavidm
requested changes
Jul 9, 2026
lidavidm
left a comment
Member
There was a problem hiding this comment.
I'd prefer a hook that lets you override entire queries, or just saying that you should override the test, rather than providing a hook just for this one test and driver.
This was referenced Jul 9, 2026
Contributor
Author
Thanks - tried a variant in #4496, let me know what you think there. |
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.
TestSqlQueryFloatsandTestSqlSchemaFloatshardcodedSELECT CAST(1.5 AS FLOAT), whoseFLOATtype name is not valid in every SQL dialect (GoogleSQL in BigQuery supports onlyFLOAT64- Spanner alsoFLOAT32).Introduce a
DriverQuirks::FloatCastTypeName()quirk defaulting toFLOATand build the cast SQL from it, so existing drivers run byte-identical SQL while other dialects can override the type name. The tests assert only the returned Arrow type and value (1.5), which are unaffected.