GitHub user Zhangshunyu opened a pull request: https://github.com/apache/incubator-carbondata/pull/103
Fix the bug that when using Decimal type as dictionary gen surrogate key will mismatch for the same values during increment load. ## Why raise this pr? **Fix bug: when using Decimal type as dictionary gen surrogate key will mismatch for the same values during increment load.** For example, when we specify Decimal type column using dictionary, as the using of `DataTypeUtil.normalizeColumnValueForItsDataType`, deciaml data for example 45, if we specify the precision of this column as 3, parsedValue would be 45.000, and this 45.000 would be written into dic file by writer.write(parsedValue). As a result, the second time we load the same data 45, dictionary.getSurrogateKey(value) would compare the value with dic value, but here the value is 45, our dic value is 45.000 stored as string, so dic would think that i don not have 45, this would lead to repeated values in dic, this is a mistake. How to solve this? Before check the surrogate key, if the datatype is decimal, we first using his parsedValue as value to check, this would not take 45 itself as different value. You can merge this pull request into a Git repository by running: $ git pull https://github.com/Zhangshunyu/incubator-carbondata decimalDic Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-carbondata/pull/103.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 #103 ---- commit 0403b9fe4ed32b9cbc4727b5a541cfccb089422e Author: Zhangshunyu <zhangshu...@huawei.com> Date: 2016-08-29T08:29:54Z Fix the bug that when Decimal type as dictionary gen surrogate key will mismatch for the same values ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---