airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siddharth Anand (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (AIRFLOW-3054) Show statements don't work in Hive hook
Date Tue, 25 Sep 2018 04:46:00 GMT

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

Siddharth Anand closed AIRFLOW-3054.
------------------------------------

> 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)

Mime
View raw message