Posted by
Akash R Nilugal (Jira) on
Oct 10, 2016; 1:54am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/jira-Commented-CARBONDATA-280-when-table-properties-is-repeated-it-only-set-the-last-one-tp1717.html
[
https://issues.apache.org/jira/browse/CARBONDATA-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15561015#comment-15561015 ]
ASF GitHub Bot commented on CARBONDATA-280:
-------------------------------------------
GitHub user Zhangshunyu reopened a pull request:
https://github.com/apache/incubator-carbondata/pull/204 [CARBONDATA-280]Fix the bug that when table properties is repeated it only set the last one
## Why raise this pr?
When table properties is repeated it only set the last one, for example,
```
CREATE TABLE IF NOT EXISTS carbontable
(ID Int, date Timestamp, country String,
name String, phonetype String, serialname String, salary Int)
STORED BY 'carbondata'
TBLPROPERTIES('DICTIONARY_EXCLUDE'='country','DICTIONARY_INCLUDE'='ID',
'DICTIONARY_EXCLUDE'='phonetype', 'DICTIONARY_INCLUDE'='salary')
```
As we use map to store the properties, only salary is set to DICTIONARY_INCLUDE and only phonetype is set to DICTIONARY_EXCLUDE.
## How to solve?
**We should do restrict syntax check that 'DICTIONARY_EXCLUDE'='country,phonetype' , 'DICTIONARY_INCLUDE'='ID,salary**' and if table properties is repeated, throw an MalformedCarbonCommandException to tell the user that Table properties is repeated, so that the user would not perform error operation.
## How to test?
Pass the exist test cases and the new test case for this bug.
## Test Result
CI has passed:
http://136.243.101.176:8080/job/ApacheCarbonManualPRBuilder/354/testReport/You can merge this pull request into a Git repository by running:
$ git pull
https://github.com/Zhangshunyu/incubator-carbondata tbprop
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-carbondata/pull/204.patchTo close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #204
----
commit 3e0030e04bff9d11f87471684b4b7b7a8d8b6209
Author: Zhangshunyu <
[hidden email]>
Date: 2016-09-28T04:50:01Z
Fix the bug that when table properties is repeated it only set the last one
commit 1828b2b78b3de9f7fa127cfcc17bf24d6c138640
Author: Zhangshunyu <
[hidden email]>
Date: 2016-09-28T05:11:12Z
Fix the test case
commit 876828400f02bb68190222e38898ccec29bb2f04
Author: Zhangshunyu <
[hidden email]>
Date: 2016-09-28T08:34:36Z
Simply
commit a7a03508b494701ec641b66449a2f0df81e2fde0
Author: Zhangshunyu <
[hidden email]>
Date: 2016-09-28T08:38:57Z
Simply
----
> when table properties is repeated it only set the last one
> -----------------------------------------------------------
>
> Key: CARBONDATA-280
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-280> Project: CarbonData
> Issue Type: Bug
> Components: sql
> Affects Versions: 0.1.1-incubating
> Reporter: zhangshunyu
> Assignee: zhangshunyu
> Priority: Minor
> Fix For: 0.2.0-incubating
>
>
> when table properties is repeated it only set the last one:
> For example,
> CREATE TABLE IF NOT EXISTS carbontable
> (ID Int, date Timestamp, country String,
> name String, phonetype String, serialname String, salary Int)
> STORED BY 'carbondata'
> TBLPROPERTIES('DICTIONARY_EXCLUDE'='country','DICTIONARY_INCLUDE'='ID',
> 'DICTIONARY_EXCLUDE'='phonetype', 'DICTIONARY_INCLUDE'='salary')
> only salary is set to DICTIONARY_INCLUDE and only phonetype is set to DICTIONARY_EXCLUDE.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)