zhangbutao commented on code in PR #3393:
URL: https://github.com/apache/hive/pull/3393#discussion_r974248833


##########
ql/src/java/org/apache/hadoop/hive/ql/Driver.java:
##########
@@ -511,13 +511,17 @@ public void compile(String command, boolean resetTaskIds, 
boolean deferClose) th
   }
 
   private void prepareForCompile(boolean resetTaskIds) throws 
CommandProcessorException {
-    driverTxnHandler.createTxnManager();
-    DriverState.setDriverState(driverState);
-    prepareContext();
-    setQueryId();
+    try {

Review Comment:
   @zabetak Maybe I didn't describe it exactly. In fact, I tried to fix two 
related issues in this PR.
   
   1. First: Beeline client can not get real exception message which is caused 
by the change(https://issues.apache.org/jira/browse/HIVE-23124).
   
   2. Second: Even though the first issus is fixed, Beeline client can not get 
valid exception state and code in the following test:
   `set hive.support.concurrency=false;`
   `set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;`
   `create table testacid(id int) stored as orc 
tblproperties('transactional'='true');`
   _**Error: Error running query: java.lang.RuntimeException: To use 
DbTxnManager you must set hive.support.concurrency=true (state=,code=0)**_
   However, In hive3, we can get valiad exception with state=42000, code=10264
   **_Error: Error while compiling statement: FAILED: RuntimeException [Error 
10264]: To use DbTxnManager you must set hive.support.concurrency=true 
(state=42000,code=10264)_**
   This change was introduced by 
https://issues.apache.org/jira/browse/HIVE-22526, which missed handling the 
exception from `driverTxnHandler#createTxnManager`, i also think we should fix 
this.



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

To unsubscribe, e-mail: [email protected]

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