A bug with TRY_TO_NUMBER() in Snowflake
It’s weird that TRY_TO_NUMBER function isn’t consistent with all alphabets,
Please run the following code,
WITH n AS (
?SELECT 65 AS num
?UNION ALL
?SELECT num + 1
???FROM n
?WHERE num < 122
)
SELECT CHAR(num), TRY_TO_NUMBER(CHAR(num)) FROM n;
You see it returns 0 when you have ‘E’ or ‘e’.
It seems obviously to be a bug unless ‘E’ or ‘e’ means something special like parsing numbers with scientific notion.
However,
E or e != 0E+0 or 0e+0
Thanks,
Kyoung Shin
Chief Data Officer at NTERSOL