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

    https://github.com/apache/incubator-carbondata/pull/82#discussion_r76749797
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtil.scala
 ---
    @@ -736,27 +761,20 @@ object GlobalDictionaryUtil extends Logging {
             logInfo("Generate global dictionary from all dictionary files!")
             val isNonempty = validateAllDictionaryPath(allDictionaryPath)
             if(isNonempty) {
    -          // fill the map[columnIndex -> columnName]
    -          var fileHeaders : Array[String] = null
    -          if(!StringUtils.isEmpty(carbonLoadModel.getCsvHeader)) {
    -            val splitColumns = carbonLoadModel.getCsvHeader.split("" + 
CSVWriter.DEFAULT_SEPARATOR)
    -            val fileHeadersArr = new ArrayBuffer[String]()
    -            for(i <- 0 until splitColumns.length) {
    -              fileHeadersArr += splitColumns(i).trim.toLowerCase()
    -            }
    -            fileHeaders = fileHeadersArr.toArray
    +          var headers = if 
(StringUtils.isEmpty(carbonLoadModel.getCsvHeader)) {
    +            getHeaderFormFactFile(carbonLoadModel)
               } else {
    -            logError("Not found file header! Please set fileheader")
    -            throw new IOException("Failed to get file header")
    +            carbonLoadModel.getCsvHeader.toLowerCase.split("" + 
CSVWriter.DEFAULT_SEPARATOR)
               }
    +          headers = headers.map(headerName => headerName.trim)
    --- End diff --
    
    headers = headers.map(_)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to