Using the escaping / unescaping code from Hive