You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Bolke de Bruin (JIRA)" <ji...@apache.org> on 2018/02/25 11:24:00 UTC
[jira] [Resolved] (AIRFLOW-1053) HiveOperator: unicode character in
HQL query produces "UnicodeEncodeError: 'ascii' codec can't encode
character ..."
[ https://issues.apache.org/jira/browse/AIRFLOW-1053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bolke de Bruin resolved AIRFLOW-1053.
-------------------------------------
Resolution: Fixed
Fix Version/s: 1.10.0
Issue resolved by pull request #3053
[https://github.com/apache/incubator-airflow/pull/3053]
> HiveOperator: unicode character in HQL query produces "UnicodeEncodeError: 'ascii' codec can't encode character ..."
> --------------------------------------------------------------------------------------------------------------------
>
> Key: AIRFLOW-1053
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1053
> Project: Apache Airflow
> Issue Type: Bug
> Components: operators
> Affects Versions: 1.8.0
> Reporter: Tomas Kafka
> Priority: Minor
> Labels: utf-8
> Fix For: 1.10.0
>
> Attachments: airflow-hive-utf.py
>
>
> Run an attached DAG, for example as:
> {quote}
> airflow test airflow-hive-sample-utf utf-snowman 2017-01-01
> {quote}
> Imporant part:
> {quote}
> unicode_snowman = unichr(0x2603)
> op_test_select = HiveOperator(
> task_id='utf-snowman',
> hql='select \'' + unicode_snowman + '\' as utf_text;',
> dag=dag)
> {quote}
> It should return a single row with an unicode snowman, but instead ends with error:
> {quote}
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u2603' in position 8: ordinal not in range(128)
> {quote}
> The same applies for unicode characters in external .hql files.
> Why is it a problem? Not because of snowmen, but I need to replace some unicode chars in a Hive ETL query.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)