Upcoming Snowflake Behaviour Change to the RIGHT Function

Snowflake announced a planned change of behavior to the the SQL RIGHT function which returns returns the rightmost substring of its input. The change is planned for July 27-31, 2020.

With the current behavior, the RIGHT function returns an empty string if the input string is shorter than the requested length.

With the new behavior the RIGHT function will return the whole input string if it is shorter than the requested length. 

See the example below:

SELECT RIGHT('hello', 2) AS "RIGHT", LEFT('hello', 2) AS "LEFT"
UNION SELECT RIGHT('hello', 5), LEFT('hello', 5)
UNION SELECT RIGHT('hello', 50), LEFT('hello', 50);

Current behavior

RIGHT LEFT
lo he
hello hello
  hello

New behavior

RIGHT LEFT
lo he
hello hello
hello  hello


While the current behavior is obviously incorrect (and inconsistent with the LEFT function) we can't rule out the option that results of your transformations might be affected or that some code is inadvertently relying on the current buggy behavior. Please feel free to contact our support (use the support button in your project) where we can provide you with further assistance (e.g. a list of possibly affected transformations or queries).