You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kg...@apache.org on 2020/01/24 16:20:25 UTC
[hive] 02/03: HIVE-22761: Scheduled query executor fails to report
query state as errored if session initialization fails (Zoltan Haindrich
reviewed by Miklos Gergely)
This is an automated email from the ASF dual-hosted git repository.
kgyrtkirk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
commit 2676818851484b4c6f36937309c3c8fa98e98e5b
Author: Zoltan Haindrich <ki...@rxd.hu>
AuthorDate: Fri Jan 24 15:24:27 2020 +0000
HIVE-22761: Scheduled query executor fails to report query state as errored if session initialization fails (Zoltan Haindrich reviewed by Miklos Gergely)
Signed-off-by: Zoltan Haindrich <ki...@rxd.hu>
---
.../hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java b/ql/src/java/org/apache/hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java
index 48bdc97..813f3af 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/scheduled/ScheduledQueryExecutionService.java
@@ -106,6 +106,9 @@ public class ScheduledQueryExecutionService implements Closeable {
private void processQuery(ScheduledQueryPollResponse q) {
SessionState state = null;
+ info = new ScheduledQueryProgressInfo();
+ info.setScheduledExecutionId(q.getExecutionId());
+ info.setState(QueryState.EXECUTING);
try {
HiveConf conf = new HiveConf(context.conf);
conf.set(Constants.HIVE_QUERY_EXCLUSIVE_LOCK, lockNameFor(q.getScheduleKey()));
@@ -113,9 +116,6 @@ public class ScheduledQueryExecutionService implements Closeable {
conf.unset(HiveConf.ConfVars.HIVESESSIONID.varname);
state = new SessionState(conf, q.getUser());
SessionState.start(state);
- info = new ScheduledQueryProgressInfo();
- info.setScheduledExecutionId(q.getExecutionId());
- info.setState(QueryState.EXECUTING);
reportQueryProgress();
try (
IDriver driver = DriverFactory.newDriver(DriverFactory.getNewQueryState(conf), null)) {