Right characters from hive string
In hive there are no commands for getting the Left and Right part of a string.
For Left it is not hard to find a workaround:
SELECT SUBSTR('abcdefgh',1,2); ab
What is the most elegant way to extract the two right hand side characters of the string?
Apparently it is possible to use negative numbers inside SUBSTR, as such you can get the relevant substring as follows:
SELECT SUBSTR('abcdefgh',-2,2); gh