当使用impala-shell -o a.txt进入impala-shell之后,查询报错:
报错情况:
Query: select * from dim_sales_dept Unknown Exception : 'ascii' codec can't encode characters in position 559-562: ordinal not in range(128)
解决方案:
问题在于python编码;
在impala-shell.py首部加入以下部分即可
28 import sys
29 import time
30 # add by niewj start
31 reload(sys)
32 sys.setdefaultencoding('utf-8')
33 # add by niewj end
34