You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Barna Zsombor Klara (JIRA)" <ji...@apache.org> on 2017/08/04 13:08:00 UTC
[jira] [Commented] (HIVE-14352) Beeline can't run sub-second
queries in HTTP mode
[ https://issues.apache.org/jira/browse/HIVE-14352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16114338#comment-16114338 ]
Barna Zsombor Klara commented on HIVE-14352:
--------------------------------------------
Hi [~gopalv],
I had a look at this Jira (better late than never I guess...) but I can't seem to be able to reproduce it. For reference this query was run from BeeLine connected to HS2 over http and has n execution time less than 1s:
{code}
0: jdbc:hive2://localhost:10001/default (default)> select * from btest;
select * from btest;
DEBUG : Acquired the compile lock.
INFO : Compiling command(queryId=zsomborklara_20170804210130_6a35b6b4-a27d-4fc8-bf1b-d85d144358cc): select * from btest
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:btest.col1, type:string, comment:null), FieldSchema(name:btest.col2, type:int, comment:null)], properties:null)
INFO : Completed compiling command(queryId=zsomborklara_20170804210130_6a35b6b4-a27d-4fc8-bf1b-d85d144358cc); Time taken: 0.068 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=zsomborklara_20170804210130_6a35b6b4-a27d-4fc8-bf1b-d85d144358cc): select * from btest
INFO : PREHOOK: query: select * from btest
INFO : PREHOOK: type: QUERY
INFO : PREHOOK: Input: default@btest
INFO : PREHOOK: Output: file:/var/folders/mf/zwgh3vt55q7b7bz5bl147_s00000gp/T/zsomborklara/7f168485-3645-4349-9be4-9b7cd791e573/hive_2017-08-04_21-01-30_116_341068566559606460-2/-mr-10001
INFO : POSTHOOK: query: select * from btest
INFO : POSTHOOK: type: QUERY
INFO : POSTHOOK: Input: default@btest
INFO : POSTHOOK: Output: file:/var/folders/mf/zwgh3vt55q7b7bz5bl147_s00000gp/T/zsomborklara/7f168485-3645-4349-9be4-9b7cd791e573/hive_2017-08-04_21-01-30_116_341068566559606460-2/-mr-10001
INFO : Completed executing command(queryId=zsomborklara_20170804210130_6a35b6b4-a27d-4fc8-bf1b-d85d144358cc); Time taken: 0.003 seconds
INFO : OK
DEBUG : Shutting down query select * from btest
+-------------+-------------+
| btest.col1 | btest.col2 |
+-------------+-------------+
| aaa | 1 |
+-------------+-------------+
1 row selected (0.157 seconds)
{code}
Looking at the code while it's true that we have a Thread.sleep(1000L), but the log thread is interrupted if the query takes less than 1 second.
{code}
InPlaceUpdateStream.EventNotifier eventNotifier =
new InPlaceUpdateStream.EventNotifier();
logThread = new Thread(createLogRunnable(stmnt, eventNotifier));
logThread.setDaemon(true);
logThread.start();
if (stmnt instanceof HiveStatement) {
HiveStatement hiveStatement = (HiveStatement) stmnt;
hiveStatement.setInPlaceUpdateStream(
new BeelineInPlaceUpdateStream(
beeLine.getErrorStream(),
eventNotifier
));
}
hasResults = stmnt.execute(sql);
logThread.interrupt(); <!!!!-------------------------------------------------
logThread.join(DEFAULT_QUERY_PROGRESS_THREAD_TIMEOUT);
{code}
Am I missing something or can you confirm that this issue has been resolved already?
> Beeline can't run sub-second queries in HTTP mode
> -------------------------------------------------
>
> Key: HIVE-14352
> URL: https://issues.apache.org/jira/browse/HIVE-14352
> Project: Hive
> Issue Type: Bug
> Components: Beeline
> Affects Versions: 2.2.0
> Reporter: Gopal V
>
> Even a 12ms query execution takes 1000+ ms in Beeline.
> {code}
> private static final int DEFAULT_QUERY_PROGRESS_INTERVAL = 1000;
> ...
> while (hiveStatement.hasMoreLogs()) {
> Thread.sleep(DEFAULT_QUERY_PROGRESS_INTERVAL);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)