hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerber, Bryan W" <>
Subject RE: Yarn Application ID for Hive query
Date Mon, 18 Jul 2016 18:47:02 GMT
Making Hive look like a normal SQL database is the goal of libraries like this, so it make
sense that that abstraction wouldn't leak a concept like application ID. Especially because
not all Hive queries generate a YARN application.

That said, we went through this with JDBC access to Hive a while back to allow our user interface
to cancel a query. Only relevant discussion I found was here:

We are using this method, plus a background task that polls the YARN resource manager API
to find the job with the corresponding It is a lot of work for something
that seems very simple. It would be nice to have access to a command or API call in HiveServer2
similar to MySQL's "SHOW PROCESSLIST" (and equivalent commands in most other databases).

From: Amit Bajpai []
Sent: Thursday, July 14, 2016 10:22 PM
Subject: Yarn Application ID for Hive query


I am using the below python program to run a hive query. How can I get the Yarn application
ID using the python program for the hive query execution.

import pyhs2

with pyhs2.connect(host='',
               database='default') as conn:
    with conn.cursor() as cur:
        #Execute query
        cur.execute("SELECT COMP_ID, COUNT(1) FROM tableA GROUP BY COMP_ID")

        #Fetch table results
        for i in cur.fetch():
            print i


Legal Disclaimer:
The information contained in this message may be privileged and confidential. It is intended
to be read only by the individual or entity to whom it is addressed or by their designee.
If the reader of this message is not the intended recipient, you are on notice that any distribution
of this message, in any form, is strictly prohibited. If you have received this message in
error, please immediately notify the sender and delete or destroy any copy of this message!

View raw message