Skip to content

Commit 9bc9ef2

Browse files
fivetran-ashashankarclaude
authored andcommitted
test: update UUID_STRING test for removed CAST
Review comments implement uuid_string 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b4dea8c commit 9bc9ef2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/dialects/test_snowflake.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,6 +2210,7 @@ def test_snowflake(self):
22102210
"SELECT UUID_STRING(), UUID_STRING('fe971b24-9572-4005-b22f-351e9c09274d', 'foo')"
22112211
)
22122212

2213+
# Note: Snowflake's UUID_STRING returns VARCHAR, DuckDB also returns VARCHAR from string operations
22132214
self.validate_all(
22142215
"UUID_STRING('fe971b24-9572-4005-b22f-351e9c09274d', 'foo')",
22152216
read={
@@ -2220,7 +2221,7 @@ def test_snowflake(self):
22202221
"spark2": "UUID()",
22212222
"spark": "UUID()",
22222223
"databricks": "UUID()",
2223-
"duckdb": "(SELECT CAST(LOWER(SUBSTRING(h, 1, 8) || '-' || SUBSTRING(h, 9, 4) || '-' || '5' || SUBSTRING(h, 14, 3) || '-' || FORMAT('{:02x}', CAST('0x' || SUBSTRING(h, 17, 2) AS INT) & 63 | 128) || SUBSTRING(h, 19, 2) || '-' || SUBSTRING(h, 21, 12)) AS UUID) FROM (SELECT SUBSTRING(SHA1(UNHEX(REPLACE('fe971b24-9572-4005-b22f-351e9c09274d', '-', '')) || ENCODE('foo')), 1, 32) AS h))",
2224+
"duckdb": "(SELECT LOWER(SUBSTRING(h, 1, 8) || '-' || SUBSTRING(h, 9, 4) || '-' || '5' || SUBSTRING(h, 14, 3) || '-' || FORMAT('{:02x}', CAST('0x' || SUBSTRING(h, 17, 2) AS INT) & 63 | 128) || SUBSTRING(h, 19, 2) || '-' || SUBSTRING(h, 21, 12)) FROM (SELECT SUBSTRING(SHA1(UNHEX(REPLACE('fe971b24-9572-4005-b22f-351e9c09274d', '-', '')) || ENCODE('foo')), 1, 32) AS h))",
22242225
"presto": "UUID()",
22252226
"trino": "UUID()",
22262227
"postgres": "GEN_RANDOM_UUID()",

0 commit comments

Comments
 (0)