Github user chenghao-intel commented on the pull request:
https://github.com/apache/spark/pull/4382#issuecomment-75919566
@liancheng thank you very much for the so detailed comment! Actually I am
quite fighting with the 2 approaches:
Single `HiveContext` Instance (with the thread local of SQLSession) V.S.
Multiple `HiveContext` Instances(with global `CacheManager` and Hive Metastore
instance etc.)
The main reasons I choice the later approach is people can create
`HiveContext` or `SQLContext` instance without any restriction when using DF
API, and then they may also using the created instances within the same
thread, in `ThreadLocal`(former one) approach, it still will causes
unpredictable behavior, unless we make the `HiveContext` or `SQLContext` as
global unique instance, but this is not we want, right?
Whatever approach we take, it's intuitive that the `CacheManager`,
`HiveMetaStore`, `FunctionRegistry` can be `Context` independent and
thread-safe, and we can put the `Context` dependent information into
`SQLContext` or `HiveContext`, like the `sqlconf` and `sessionState`.
What do you think?
---
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]