[
https://issues.apache.org/jira/browse/HIVE-26345?focusedWorklogId=798813&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-798813
]
ASF GitHub Bot logged work on HIVE-26345:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Aug/22 08:20
Start Date: 08/Aug/22 08:20
Worklog Time Spent: 10m
Work Description: zhangbutao commented on PR #3393:
URL: https://github.com/apache/hive/pull/3393#issuecomment-1207815099
@zabetak After further investigation, i found HIVE-22526 separateed txn
related codes from compile codes which lead to exception(errorCode 10264) from
txn not being catched and converted into `CommandProcessorException`. I fixed
this regression by catch txn exception in txn code block.
After fixing, we can get txn exception whth errorCode(10264) and
state(42000).
`Error: Error while compiling statement: FAILED: RuntimeException [Error
10264]: To use DbTxnManager you must set hive.support.concurrency=true
(state=42000,code=10264)`
BTW, for other exception which may not exist in` ErrorMsg class`, shoud we
add a generic error code in `ErrorMsg class` or simply throw message? I have
seen lots of code which handle `HiveSQLException` like this:
`throw new HiveSQLException("Error running query: " + e.toString(), e);`
Issue Time Tracking
-------------------
Worklog Id: (was: 798813)
Time Spent: 50m (was: 40m)
> SQLOperation class output real exception message to jdbc client
> ---------------------------------------------------------------
>
> Key: HIVE-26345
> URL: https://issues.apache.org/jira/browse/HIVE-26345
> Project: Hive
> Issue Type: Improvement
> Components: HiveServer2
> Affects Versions: 4.0.0-alpha-2
> Reporter: zhangbutao
> Assignee: zhangbutao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Beeline client may can not get real exception from _*SQLOperation class*_ and
> user may don't how to fix query based on client exception massage.
> Step to repro:
> {code:java}
> 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');{code}
> Beeline console output exception:
> {code:java}
> Error: Error running query (state=,code=0) {code}
>
> However, Hive3 beeline can output readable exception information:
> {code:java}
> Error: Error while compiling statement: FAILED: RuntimeException [Error
> 10264]: To use DbTxnManager you must set hive.support.concurrency=true
> (state=42000,code=10264) {code}
>
> This change was introduced by HIVE-23124, i think we should fix this to
> output real exception to prompt users to amend the query.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)