You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Aizhamal Nurmamat kyzy (JIRA)" <ji...@apache.org> on 2019/05/17 21:14:01 UTC

[jira] [Reopened] (AIRFLOW-3054) Show statements don't work in Hive hook

     [ https://issues.apache.org/jira/browse/AIRFLOW-3054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aizhamal Nurmamat kyzy reopened AIRFLOW-3054:
---------------------------------------------

Reopening issues for component refactor. Will resolve them afterwards. 

> Show statements don't work in Hive hook 
> ----------------------------------------
>
>                 Key: AIRFLOW-3054
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3054
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: hive_hooks
>            Reporter: Anton Protopopov
>            Assignee: Anton Protopopov
>            Priority: Minor
>
> Currently in airflow.hooks.hive_hooks.py in HiveServer2Hook class in _get_results method there are filter for incoming hql:
> source code: https://github.com/apache/incubator-airflow/blob/a79b92ae40c005d8239dfc7711ff44ae69b9c65b/airflow/hooks/hive_hooks.py#L809-L814
> {code:java}
>                 # we only get results of statements that returns
>                 lowered_statement = statement.lower().strip()
>                 if (lowered_statement.startswith('select') or
>                     lowered_statement.startswith('with') or
>                     (lowered_statement.startswith('set') and
>                     '=' not in lowered_statement)):
> {code}
> Queries which starts with show also returning results (like "show tables in default", or "show partitions in default.table_name").
> So I'm thinking it worth to add another statement which starts with "show":
> {code:java}
> lowered_statement.startswith('show')
> {code}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)