def str_to_unicode(s, encoding):
    if isinstance(s, str):
        return unicode(s, encoding, 'replace')
    else:
        return s
Text of query to run in hive
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/django/http/__init__.py/str_to_unicode--crossover with--dataset/ETHPy150Open spotify/luigi/luigi/contrib/hive.py/HiveQueryTask.query