carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #310: [CARBONDATA-401] One Pass Load
Date Thu, 29 Dec 2016 01:22:32 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/310#discussion_r94093526
  
    --- Diff: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
---
    @@ -402,16 +430,57 @@ case class LoadTable(
             carbonLoadModel.setColDictFilePath(columnDict)
             carbonLoadModel.setDirectLoad(true)
             GlobalDictionaryUtil.updateTableMetadataFunc = updateTableMetadata
    -        GlobalDictionaryUtil
    -          .generateGlobalDictionary(sqlContext, carbonLoadModel, relation.tableMeta.storePath,
    -            dataFrame)
    +
    +        if (carbonLoadModel.getUseOnePass) {
    +          val colDictFilePath = carbonLoadModel.getColDictFilePath
    +          if (colDictFilePath != null) {
    +            val storePath = relation.tableMeta.storePath
    +            val carbonTable = carbonLoadModel.getCarbonDataLoadSchema.getCarbonTable
    +            val carbonTableIdentifier = carbonTable.getAbsoluteTableIdentifier
    +              .getCarbonTableIdentifier
    +            val carbonTablePath = CarbonStorePath
    +              .getCarbonTablePath(storePath, carbonTableIdentifier)
    +            val dictFolderPath = carbonTablePath.getMetadataDirectoryPath
    +            val dimensions = carbonTable.getDimensionByTableName(
    +              carbonTable.getFactTableName).asScala.toArray
    +            carbonLoadModel.initPredefDictMap()
    +            // generate predefined dictionary
    +            GlobalDictionaryUtil
    +              .generatePredefinedColDictionary(colDictFilePath, carbonTableIdentifier,
    +                dimensions, carbonLoadModel, sqlContext, storePath, dictFolderPath)
    +          }
    +          // dictionaryServerClient dictionary generator
    +          val dictionaryServerPort = CarbonProperties.getInstance()
    +            .getProperty(CarbonCommonConstants.DICTIONARY_SERVER_PORT,
    +              CarbonCommonConstants.DICTIONARY_SERVER_PORT_DEFAULT)
    +          carbonLoadModel.setDictionaryServerPort(Integer.parseInt(dictionaryServerPort))
    +          val sparkDriverHost = sqlContext.sparkContext.getConf.get("spark.driver.host")
    +          carbonLoadModel.setDictionaryServerHost(sparkDriverHost)
    +          // start dictionary server when use one pass load.
    +          executorService = Executors.newFixedThreadPool(1)
    +          result = executorService.submit(new Callable[DictionaryServer]() {
    +            @throws[Exception]
    --- End diff --
    
    why this is added?


---
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