我想从Hadoop数据库中读取除ACSII字符以外的其他字符的数据。我正在尝试使用.py文件读取数据。我用过
#!/usr/bin/env python
# -*- coding: utf-8 -*-
指定编码
我使用下面的查询来提取数据
def hiveconnection(host_name, port, user, database):
conn = hive.Connection(host=host_name, port=port, username=user, database=database, auth='KERBEROS', kerberos_service_name='impala')
cur = conn.cursor()
cur.execute(" select * from db_name.table_name ")
result = cur.fetchall()
return result
output = hiveconnection(host_name, port, user, database)
denialt2= pd.DataFrame(output)
我收到了错误信息。错误消息:“utf-8”编解码器无法解码位置13中的字节0x96:无效的开始字节”。在调查错误消息时,我知道它抛出错误消息是因为ASCII字符以外的特殊字符。从其中一列粘贴下面的特殊字符
附加完整的回溯(错误消息)
请帮我解决这个问题。提前感谢:)
目前没有回答
相关问题 更多 >
编程相关推荐