pralabhkumar created AIRFLOW-1209:
-------------------------------------

             Summary: Hive Hook with beeline doesn't execute query if hql query 
doesn't have \n in the end
                 Key: AIRFLOW-1209
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1209
             Project: Apache Airflow
          Issue Type: Improvement
          Components: hive_hooks
    Affects Versions: Airflow 1.8
            Reporter: pralabhkumar


Airflow Hive operator doesn't run the query if the query doesn't end with \n . 
I am using hive 1.2 beeline .  If I used just below query 
hql="select count(*) from test;"
in my HiveOpertor ,then the query doesn't run. Since beeline require \n at the 
end of the file .

But can we make sure in hive_hooks.py ,we by default add \n ,and doesn't leave 
the same to the user .

Code should change to 

hql = "USE {schema};\n{hql}\n".format(**locals())

instead of

hql = "USE {schema};\n{hql}".format(**locals())

Though this issue is fixed by beeline 
https://issues.apache.org/jira/browse/HIVE-10541 
in later version 

But for back word compatibility can we do the change in hive_hooks.py




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to