[ 
https://issues.apache.org/jira/browse/HIVE-11402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14646917#comment-14646917
 ] 

Carl Steinbach commented on HIVE-11402:
---------------------------------------

bq. Note that running queries in parallel for single session is not 
straightforward with jdbc, you need to spawn another thread as the 
Statement.execute calls are blocking. I believe ODBC has non blocking query 
execution API ...

I made a couple mistakes when I designed the HS2 API (the use of Thrift Enums 
and Unions comes to mind), but by far the biggest mistake was allowing a 1:many 
relationship between Sessions and Operations. At the time I thought there was a 
chance that the ODBC spec required this, but now think this is something best 
handled on the client side. Providing support for the 1:many Session:Operation 
mapping results in a lot of additional complexity on the server-side, only to 
yield a feature with a very high potential for misuse.

Rather than temporarily serializing operations against a given session, I 
propose instead that we enforce a 1:1 mapping between HS2 sessions and active 
operations. This is a backward incompatible change, but one which I think will 
yield far better results in the long term.

> HS2 - disallow parallel query execution within a single Session
> ---------------------------------------------------------------
>
>                 Key: HIVE-11402
>                 URL: https://issues.apache.org/jira/browse/HIVE-11402
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>            Reporter: Thejas M Nair
>
> HiveServer2 currently allows concurrent queries to be run in a single 
> session. However, every HS2 session has  an associated SessionState object, 
> and the use of SessionState in many places assumes that only one thread is 
> using it, ie it is not thread safe.
> There are many places where SesssionState thread safety needs to be 
> addressed, and until then we should serialize all query execution for a 
> single HS2 session. -This problem can become more visible with HIVE-4239 now 
> allowing parallel query compilation.-
> Note that running queries in parallel for single session is not 
> straightforward  with jdbc, you need to spawn another thread as the 
> Statement.execute calls are blocking. I believe ODBC has non blocking query 
> execution API, and Hue is another well known application that shares sessions 
> for all queries that a user runs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to