carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lionelcao <...@git.apache.org>
Subject [GitHub] incubator-carbondata pull request #882: [CARBONDATA-936] Parse partition tab...
Date Fri, 05 May 2017 09:31:47 GMT
Github user lionelcao commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/882#discussion_r114960569
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
---
    @@ -347,43 +356,65 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser
{
       }
     
       /**
    -   * For getting the partitioner Object
    -   *
    +   * get partition info
        * @param partitionCols
        * @param tableProperties
    -   * @return
        */
    -  protected def getPartitionerObject(partitionCols: Seq[PartitionerField],
    -      tableProperties: Map[String, String]):
    -  Option[Partitioner] = {
    -
    -    // by default setting partition class empty.
    -    // later in table schema it is setting to default value.
    -    var partitionClass: String = ""
    -    var partitionCount: Int = 1
    -    var partitionColNames: Array[String] = Array[String]()
    -    if (tableProperties.get(CarbonCommonConstants.PARTITIONCLASS).isDefined) {
    -      partitionClass = tableProperties.get(CarbonCommonConstants.PARTITIONCLASS).get
    +  protected def getPartitionInfo(partitionCols: Seq[PartitionerField],
    +      tableProperties: Map[String, String]): Option[PartitionInfo] = {
    +    var partitionType: String = ""
    +    var hashNumber = 0
    +    var rangeInfo = List[String]()
    +    var listInfo = ListBuffer[List[String]]()
    +    var templist = ListBuffer[String]()
    +    if (tableProperties.get(CarbonCommonConstants.PARTITION_TYPE).isDefined) {
    +      partitionType = tableProperties.get(CarbonCommonConstants.PARTITION_TYPE).get
         }
    -
    -    if (tableProperties.get(CarbonCommonConstants.PARTITIONCOUNT).isDefined) {
    -      try {
    -        partitionCount = tableProperties.get(CarbonCommonConstants.PARTITIONCOUNT).get.toInt
    -      } catch {
    -        case e: Exception => // no need to do anything.
    +    if (tableProperties.get(CarbonCommonConstants.HASH_NUMBER).isDefined) {
    +      hashNumber = tableProperties.get(CarbonCommonConstants.HASH_NUMBER).get.toInt
    +    }
    +    if (tableProperties.get(CarbonCommonConstants.RANGE_INFO).isDefined) {
    +      rangeInfo = tableProperties.get(CarbonCommonConstants.RANGE_INFO).get.replace("
", "")
    --- End diff --
    
    Could you explain more details?


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