A negative number: substring(str, -4) would work as well as a substitute for RIGHT(str, 4)
from Athena documentation: A negative starting position is interpreted as being relative to the end of the string.