Hi everyone,

I would like to execute a Hive query on the server in an asynchronous
manner. The Hive query will likely take a long time to complete, so I would
prefer not to block on the call. I am currently using Thirft to make a
blocking call (blocks on client.execute()), but I have not seen an example
of how to make a non-blocking call. Here is the blocking code:

TSocket transport = new TSocket("hive.example.com", 10000);
TBinaryProtocol protocol = new TBinaryProtocol(transport);
Client client = new ThriftHive.Client(protocol);
client.execute(hql); // Omitted HQL

List<String> rows;
while ((rows = client.fetchN(1000)) != null) {
for (String row : rows) {
// Do stuff with row


The code above is missing try/catch blocks to keep it short.

I can see that Thirft has things like "TNonblockingSocket" but I cannot find
any examples of how to use it, or if Hive even supports it. Does anyone have
any ideas how to do an async call? Is there a better way?


Kind regards,
Peter Sankauskas

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupuser @
categorieshive, hadoop
postedFeb 2, '10 at 5:43p
activeFeb 3, '10 at 9:11a

2 users in discussion

Zheng Shao: 1 post Peter Sankauskas: 1 post



site design / logo © 2022 Grokbase