You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by lion-x <gi...@git.apache.org> on 2016/11/07 04:03:27 UTC

[GitHub] incubator-carbondata pull request #299: [CARBONDATA-384]Add Table Properties...

GitHub user lion-x opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/299

    [CARBONDATA-384]Add Table Properties Options Validation

    # Why raise this PR?
    Now, Carbon does not validate the table properties options. This will cause below problem.
    For example,
    Create table carbontable (.......)
    TBLPROPERTIES ('DICTIONARY_EXELUDE'='colname');
    user wants to use DICTIONARY_EXCLUDE property, but he types a wrong option name, the setting will be ignored with no error throw.
    
    # How to test?
    Pass all test case.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lion-x/incubator-carbondata validateTblOptions

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/299.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #299
    
----
commit f19122e5441835a9a4298fb327eb80c373810e6e
Author: lion-x <xl...@gmail.com>
Date:   2016-11-07T04:00:19Z

    validateTblOptions

----


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

[GitHub] incubator-carbondata pull request #299: [CARBONDATA-384][WIP]Add Table Prope...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/299#discussion_r87615082
  
    --- Diff: integration/spark/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala ---
    @@ -122,14 +122,29 @@ object CommonUtil {
         var isValid: Boolean = true
         tableProperties.foreach {
           case (key, value) =>
    -        if (!validateFields(key, fields)) {
    +        if (!validateTblOption(key) || !validateFields(key, fields)) {
               isValid = false
               throw new MalformedCarbonCommandException(s"Invalid table properties ${ key }")
             }
         }
         isValid
       }
     
    +  def validateTblOption(option: String): Boolean = {
    +    val supportedOptions = Seq[String]("DICTIONARY_EXCLUDE", "DICTIONARY_INCLUDE", "COLUMN_GROUPS",
    +      "TABLE_BLOCKSIZE", "NO_INVERTED_INDEX", "PARTITIONCLASS", "PARTITIONCOUNT",
    --- End diff --
    
    By this way, it is easy to forget to update this list if later more options are added. Better to refactory the options, like make it a Enum, and use it in both parser and here


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

[GitHub] incubator-carbondata issue #299: [CARBONDATA-384][WIP]Add Table Properties O...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/299
  
    Can one of the admins verify this patch?


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

[GitHub] incubator-carbondata pull request #299: [CARBONDATA-384][WIP]Add Table Prope...

Posted by lion-x <gi...@git.apache.org>.
Github user lion-x closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/299


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