tekumara / fakesnow

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
Apache License 2.0
100 stars 9 forks source link

fix(json extraction): only return string when casting to varchar #77

Closed seruman closed 5 months ago

seruman commented 6 months ago

Not sure if intentional but despite doc comment Return raw unquoted string when casting json extraction to varchar, json_extract_cast_as_varchar transforms all CASTs on JSON extraction to VARCHAR.

-- snowflake
select parse_json('{"fruit":"9000"}'):fruit::number

-- becomes in duckdb;
SELECT JSON('{"fruit":"9000"}') ->> '$.fruit'