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



##########
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:
       @mustafaiman,
   I added a unittest to verify it and looks like it still works this way. 
HiveHplSqlSessionState holds a reference to SessionState which changes when the 
the current db is modified. The reason why the HiveHplSqlSessionState is still 
needed is because the SessionState is in the ql project which cannot be 
referenced from hplsql without introducing circular dependency.




----------------------------------------------------------------
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