Github user mohammadshahidkhan commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1841#discussion_r163154276
  
    --- Diff: 
integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
 ---
    @@ -941,4 +943,39 @@ object CommonUtil {
         }
       }
     
    +  def setTempStoreLocation(
    +      index: Int,
    +      carbonLoadModel: CarbonLoadModel,
    +      isCompactionFlow: Boolean,
    +      isAltPartitionFlow: Boolean) : Unit = {
    +    var storeLocation: String = null
    +
    +    // this property is used to determine whether temp location for carbon 
is inside
    +    // container temp dir or is yarn application directory.
    +    val carbonUseLocalDir = CarbonProperties.getInstance()
    +      .getProperty("carbon.use.local.dir", "false")
    +
    +    if (carbonUseLocalDir.equalsIgnoreCase("true")) {
    +
    +      val storeLocations = Util.getConfiguredLocalDirs(SparkEnv.get.conf)
    +      if (null != storeLocations && storeLocations.nonEmpty) {
    +        storeLocation = 
storeLocations(Random.nextInt(storeLocations.length))
    +      }
    +      if (storeLocation == null) {
    +        storeLocation = System.getProperty("java.io.tmpdir")
    +      }
    +    } else {
    +      storeLocation = System.getProperty("java.io.tmpdir")
    +    }
    +    storeLocation = storeLocation + '/' + "carbon" + System.nanoTime() + 
'_' + index
    --- End diff --
    
    Please use CarbonCommonConstants.FILE_SEPARATOR & 
CarbonCommonConstants.UNDERSCORE instead of hard coded litral.
     


---

Reply via email to