Home > Database > Mysql Tutorial > hue 支持hive 查询结果数据导出支持中文编码GBK

hue 支持hive 查询结果数据导出支持中文编码GBK

WBOY
Release: 2016-06-07 16:34:53
Original
3216 people have browsed it

既然是hive的查询结果那么我们肯定要修改 hue apps里的beeswax/src/beeswax vim data_export.py 在def download(handle, format, db): 上添加代码: EXPORT_CHART_SET='gb2312' 然后修改 def download(handle, format, db) 里面的CSVformatter 和CSVformatte

既然是hive的查询结果那么我们肯定要修改 hue apps里的beeswax/src/beeswax

 vim data_export.py 
Copy after login

在def download(handle, format, db): 上添加代码:

EXPORT_CHART_SET='gb2312'
Copy after login

然后修改 def download(handle, format, db) 里面的CSVformatter 和CSVformatter 增加我们上面定义的变量作为参数。

if format == 'csv':
    formatter = CSVformatter(EXPORT_CHART_SET) #yangqijun.com
    mimetype = 'application/csv'
  elif format == 'xls':
    formatter = CSVformatter(EXPORT_CHART_SET) #yangqijun.com
    mimetype = 'application/xls'
Copy after login

然后重新启动 一下即可

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template