Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1455#discussion_r148946439
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/LoadTableCommand.scala
---
@@ -84,6 +84,10 @@ case class LoadTableCommand(
val carbonProperty: CarbonProperties = CarbonProperties.getInstance()
carbonProperty.addProperty("zookeeper.enable.lock", "false")
+ carbonProperty.addProperty(CarbonCommonConstants.NUM_CORES_LOADING,
+ carbonProperty.getProperty(CarbonCommonConstants.NUM_CORES_LOADING,
+
Math.min(sparkSession.sparkContext.conf.getInt("spark.executor.cores", 1),
+ CarbonCommonConstants.NUM_CORES_MAX_VAL).toString()))
--- End diff --
The logic of this code block will be:
```
// TODO: describe why doing this
val numCoresLoading =
Math.min(
sparkSession.sparkContext.conf.getInt("spark.executor.cores", 1),
carbonProperty.getProperty(CarbonCommonConstants.NUM_CORES_LOADING,
NUM_CORES_DEFAULT_VAL)
)
// update the property with new value
carbonProperty.addProperty(CarbonCommonConstants.NUM_CORES_LOADING,
numCoresLoading)
```
---