You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by gvramana <gi...@git.apache.org> on 2018/07/17 14:42:46 UTC
[GitHub] carbondata pull request #2484: [HOTFIX] added hadoop conf to thread local
Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2484#discussion_r203050151
--- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
@@ -43,11 +45,19 @@
*/
private static final LogService LOGGER =
LogServiceFactory.getLogService(FileFactory.class.getName());
- private static Configuration configuration = null;
- static {
- configuration = new Configuration();
- configuration.addResource(new Path("../core-default.xml"));
+ public static Configuration getConfiguration() {
+ Configuration configuration;
+ if (ThreadLocalSessionInfo.getCarbonSessionInfo() == null) {
+ configuration = new Configuration();
+ configuration.addResource(new Path("../core-default.xml"));
+ } else {
+ CarbonConfiguration carbonConfiguration =
+ (CarbonConfiguration) ThreadLocalSessionInfo.getCarbonSessionInfo().getThreadParams()
--- End diff --
Also handle case carbonConf not present even ThreadLocalSessionInfo is present, required for other than spark cases
---