zhengchenyu commented on PR #44572: URL: https://github.com/apache/spark/pull/44572#issuecomment-1875151150
Each session should use its own hiveconfig. HiveSessionImpl::acquire sets the SessionSate of the current session to the threadlocal variable. Theoretically we can use SessionState.get directly and then get our own hiveconfig from it. However, since IsolatedClientLoader will reload the SessionState class, and SessionState::tss is a static variable, SessionState::tss will be reinitialized, so SessionState is lost. Therefore, I introduced HiveContext::sessionHiveConfBuffer to store hiveConfig. Because HiveContext is a sharedClass, the class will not be reloaded and the sessionHiveConfBuffer will not be reinitialized. Why introduce bytebuffer instead of hiveConfig directly? Because the version of HiveConfig builtin spark may be different from the version of HiveConfig loaded by IsolatedClientLoader, and an error will be reported when running. -- 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]
