mustafaiman commented on a change in pull request #1633:
URL: https://github.com/apache/hive/pull/1633#discussion_r516368001



##########
File path: 
service/src/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java
##########
@@ -45,6 +62,21 @@ public static ExecuteStatementOperation 
newExecuteStatementOperation(HiveSession
       throws HiveSQLException {
 
     String cleanStatement = HiveStringUtils.removeComments(statement);
+    if (!HPLSQL.equals(confOverlay.get(QUERY_EXECUTOR)) && hplSqlMode()) {
+      if (SessionState.get().getHplsqlInterpreter() == null) {
+        Exec interpreter = new Exec(
+                new Conf(),
+                new BeelineConsole(),
+                ResultListener.NONE,
+                new HplSqlQueryExecutor(parentSession),
+                parentSession.getMetaStoreClient(),
+                new HiveHplSqlSessionState(SessionState.get())

Review comment:
       So this gets a reference to active SessionState. Then it is offloaded to 
another background thread to run. What if the next operation changes 
sessionState.currentDatabase? Then hpl operation might run on wrong database, 
no?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to