Tag: JSON

25 January 2021

Decimal Values are Converted to Integer Values

Today, I have learnt that Snowflake will convert decimal values to integer values if all trailings are zeros. Please see below examples: It returns: The same applies to PARSE_JSON: It returns: Instead of: After researching with our team, it turned out that it was expected behaviour. In fact, Snowflake has been behaving this way for a long time. However, for the PARSE_JSON, it was recently […]

11 October 2020

How to parse special characters in PARSE_JSON function

Sometimes it can be confusing when trying to parse JSON string, this is no different when using PARSE_JSON function in Snowflake, especially when there are special characters involved. Look at below examples when I need to have backslash inside the key string: We can see that both of 2 and 3 backslashes produced errors, while 4 backslash returned value as “my\\id“, which contains 2 backslashes. […]