ajantha-bhat commented on a change in pull request #3697: [HOTFIX] Refactored hive related classes to use constants URL: https://github.com/apache/carbondata/pull/3697#discussion_r405224399
########## File path: integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonOutputFormat.java ########## @@ -61,24 +68,32 @@ public void checkOutputSpecs(FileSystem fileSystem, JobConf jobConf) throws IOEx public FileSinkOperator.RecordWriter getHiveRecordWriter(JobConf jc, Path finalOutPath, Class<? extends Writable> valueClass, boolean isCompressed, Properties tableProperties, Progressable progress) throws IOException { + ThreadLocalSessionInfo.setConfigurationToCurrentThread(jc); CarbonLoadModel carbonLoadModel = null; + // Try to get loadmodel from JobConf. String encodedString = jc.get(LOAD_MODEL); if (encodedString != null) { carbonLoadModel = (CarbonLoadModel) ObjectSerializationUtil.convertStringToObject(encodedString); - } - if (carbonLoadModel == null) { - carbonLoadModel = HiveCarbonUtil.getCarbonLoadModel(tableProperties, jc); } else { - for (Map.Entry<Object, Object> entry : tableProperties.entrySet()) { - carbonLoadModel.getCarbonDataLoadSchema().getCarbonTable().getTableInfo().getFactTable() - .getTableProperties().put(entry.getKey().toString().toLowerCase(), - entry.getValue().toString().toLowerCase()); + // Try to get loadmodel from Container environment. + encodedString = System.getenv("carbon"); + if (encodedString != null) { + carbonLoadModel = + (CarbonLoadModel) ObjectSerializationUtil.convertStringToObject(encodedString); + } else { + carbonLoadModel = HiveCarbonUtil.getCarbonLoadModel(tableProperties, jc); } } + for (Map.Entry<Object, Object> entry : tableProperties.entrySet()) { Review comment: ok ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services