Github user liancheng commented on the pull request:

    https://github.com/apache/spark/pull/4001#issuecomment-70441804
  
    `HiveShim.getCommandProcess` delegates to methods defined in 
`CommandProcessorFactory`, which tries to find a cached `Driver` object and 
initialize it. The underlying `Driver` cache map is synchronized. However, I'm 
not quite sure whether `Driver` is thread-safe. Also, `HiveServer2` actually 
creates a new `Driver` instance for every SQL statement and never caches them. 
Considering all the above, I'd agree that the risks is greater than the 
benefits. A better solution for this is to avoid using 
`HiveShim.getCommandProcess` (which caches `Driver` objects) but mimicing what 
`HiveServer2` does and create new `Driver` instances for every SQL statement.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to