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

    https://github.com/apache/incubator-carbondata/pull/82#discussion_r76736815
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
 ---
    @@ -650,6 +650,51 @@ object GlobalDictionaryUtil extends Logging {
       }
     
       /**
    +   * get file headers from fact file
    +   *
    +   * @param carbonLoadModel
    +   * @return headers
    +   */
    +  private def getHeaderFormFactFile(carbonLoadModel: CarbonLoadModel): 
Array[String] = {
    +    var headers: Array[String] = null
    +    var factFile: String = null
    +    val fileType = FileFactory.getFileType(carbonLoadModel.getFactFilePath)
    +    val filePath = 
FileFactory.getCarbonFile(carbonLoadModel.getFactFilePath, fileType)
    +    if (filePath.isDirectory) {
    +      val listFiles = filePath.getParentFile.listFiles()
    --- End diff --
    
    @foryou2030 ....Please clarify the below points.
    1. Why you are using filePath.getParentFile?
    2. There can be a case where one folder can contain only subFolders. In 
that case you will not be find a csv file. Ideally to find a file it should be 
a recursive call.
    
    @QiangCai ...please review this method and correct me if I am wrong


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to