You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Shubham Gupta (JIRA)" <ji...@apache.org> on 2019/01/05 12:06:00 UTC
[jira] [Created] (AIRFLOW-3633) DESCRIBE table via HiverServer2Hook
Shubham Gupta created AIRFLOW-3633:
--------------------------------------
Summary: DESCRIBE table via HiverServer2Hook
Key: AIRFLOW-3633
URL: https://issues.apache.org/jira/browse/AIRFLOW-3633
Project: Apache Airflow
Issue Type: Wish
Components: hive_hooks
Affects Versions: 1.10.0
Reporter: Shubham Gupta
It seems a bit unfair that [HiveServer2Hook.get_records()|https://github.com/apache/airflow/blob/v1-10-stable/airflow/hooks/hive_hooks.py#L855] only allows SELECT (and WITH c.t.e.) queries as of [v1.10|https://github.com/apache/airflow/blob/v1-10-stable/airflow/hooks/hive_hooks.py#L787]
While allowed queries have been [expanded|https://github.com/apache/airflow/blob/master/airflow/hooks/hive_hooks.py#L811] in master but it still isn't an exhaustive set.
My use-case involved DESCRIBE queries on tables and while I can use [headers|https://github.com/apache/airflow/blob/v1-10-stable/airflow/hooks/hive_hooks.py#L813] field from [get_results()|https://github.com/apache/airflow/blob/v1-10-stable/airflow/hooks/hive_hooks.py#L808] method, it isn't the same as some extra work is required to process the results from cursor description:
* Column names are prefixed with table name
* Data-types (strings) are not same as Hive
Is there a specific reason to support only limited set of queries (amongst those that return result)? If no, can we please have DESCRIBE queries too?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)