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 #882: [CARBONDATA-936] Parse partition tab...
Date Mon, 08 May 2017 01:45:52 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/882#discussion_r115162314
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
---
    @@ -144,6 +145,41 @@ object CommonUtil {
         isValid
       }
     
    +  /**
    +   * 1. If partitioned by clause exists, then partition_type should be defined
    +   * 2. If partition_type is Hash, then hash_number should be defined
    +   * 3. If partition_type is List, then list_info should be defined
    +   * 4. If partition_type is Range, then range_info should be defined
    +   * 5. Only support single level partition for now
    +   * @param tableProperties
    +   * @param partitionCols
    +   * @return
    +   */
    +  def validatePartitionColumns(tableProperties: Map[String, String],
    +      partitionCols: Seq[StructField]): Boolean = {
    +    var isValid: Boolean = true
    +    val partitionType = tableProperties.get(CarbonCommonConstants.PARTITION_TYPE)
    +    val hashNumber = tableProperties.get(CarbonCommonConstants.HASH_NUMBER)
    +    val rangeInfo = tableProperties.get(CarbonCommonConstants.RANGE_INFO)
    +    val listInfo = tableProperties.get(CarbonCommonConstants.LIST_INFO)
    +
    +    // partition column and partition_type should be both exist or not exist
    +    if (partitionCols.isEmpty ^ partitionType.isEmpty) {
    --- End diff --
    
    use | or & for better readability


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