feat(duckdb): Add tests for TO_CHAR#7635
Merged
Merged
Conversation
georgesittas
approved these changes
May 12, 2026
d04321d to
2797047
Compare
Contributor
SQLGlot Integration Test ResultsComparing:
By Dialect
Overallsqlglot:cold-prql-test: 101037 total, 101036 passed (pass rate: 100.0%), sqlglot version: sqlglot:RD-1069318-to-char-to-varchar: 101037 total, 101037 passed (pass rate: 100.0%), sqlglot version: Transitions: ✅ 62 test(s) passed |
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.
https://fivetran.atlassian.net/browse/RD-1069318
Problem: TO_CHAR(numeric, 'format') in Snowflake uses Oracle-style numeric format patterns (e.g. '99999.99'). When transpiling to DuckDB, the format argument was silently dropped, producing CAST(x AS TEXT) without any indication of the loss.
Solution: Confirmed the current CAST(x AS TEXT) + @unsupported_args("format") warning in the base generator is already the correct fallback — DuckDB has no native Oracle numeric format function and a partial translator would produce silently wrong results for several patterns (B, S, MI, EEEE). Added 4 integration tests to the submodule documenting the exact transpilation behavior for all cases: numeric (no format), TO_VARCHAR alias, date format (working via STRFTIME), and numeric with Oracle format (known limitation).