carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1144: [WIP] String datatype will be no dictionary c...
Date Fri, 07 Jul 2017 00:58:35 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1144#discussion_r126050365
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonGlobalDictionaryRDD.scala
---
    @@ -375,90 +372,72 @@ class CarbonGlobalDictionaryGenerateRDD(
                 val distinctValueList = rddIter.next()._2
                 valuesBuffer ++= distinctValueList.values
                 rowCount += distinctValueList.rowCount
    -            // check high cardinality
    -            if (model.isFirstLoad && model.highCardIdentifyEnable
    -                && !model.isComplexes(split.index)
    -                && model.primDimensions(split.index).isColumnar) {
    -              isHighCardinalityColumn = GlobalDictionaryUtil.isHighCardinalityColumn(
    -                valuesBuffer.size, model)
    -              if (isHighCardinalityColumn) {
    -                break
    -              }
    -            }
               }
             }
             val combineListTime = System.currentTimeMillis() - t1
    -        if (isHighCardinalityColumn) {
    -          LOGGER.info(s"column ${ model.table.getTableUniqueName }." +
    -                      s"${
    -                        model.primDimensions(split.index)
    -                          .getColName
    -                      } is high cardinality column")
    +        isDictionaryLocked = dictLock.lockWithRetries()
    +        if (isDictionaryLocked) {
    +          logInfo(s"Successfully able to get the dictionary lock for ${
    +            model.primDimensions(split.index).getColName
    +          }")
             } else {
    -          isDictionaryLocked = dictLock.lockWithRetries()
    -          if (isDictionaryLocked) {
    -            logInfo(s"Successfully able to get the dictionary lock for ${
    +          sys
    +            .error(s"Dictionary file ${
                   model.primDimensions(split.index).getColName
    -            }")
    -          } else {
    -            sys
    -              .error(s"Dictionary file ${
    -                model.primDimensions(split.index).getColName
    -              } is locked for updation. Please try after some time")
    -          }
    -          val t2 = System.currentTimeMillis
    -          val fileType = FileFactory.getFileType(model.dictFilePaths(split.index))
    -          model.dictFileExists(split.index) = FileFactory
    -            .isFileExist(model.dictFilePaths(split.index), fileType)
    -          dictionaryForDistinctValueLookUp = if (model.dictFileExists(split.index)) {
    -            CarbonLoaderUtil.getDictionary(model.table,
    -              model.columnIdentifier(split.index),
    -              model.hdfsLocation,
    -              model.primDimensions(split.index).getDataType
    -            )
    -          } else {
    -            null
    -          }
    -          val dictCacheTime = System.currentTimeMillis - t2
    -          val t3 = System.currentTimeMillis()
    -          val dictWriteTask = new DictionaryWriterTask(valuesBuffer,
    -            dictionaryForDistinctValueLookUp,
    -            model.table,
    +            } is locked for updation. Please try after some time")
    +        }
    +        val t2 = System.currentTimeMillis
    +        val fileType = FileFactory.getFileType(model.dictFilePaths(split.index))
    +        model.dictFileExists(split.index) = FileFactory
    --- End diff --
    
    I think you can put this check in below `if` clause


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

Mime
View raw message