You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by xuchuanyin <gi...@git.apache.org> on 2018/08/15 03:03:12 UTC

[GitHub] carbondata pull request #2635: [CARBONDATA-2856] Fix bug in bloom index on m...

GitHub user xuchuanyin opened a pull request:

    https://github.com/apache/carbondata/pull/2635

    [CARBONDATA-2856] Fix bug in bloom index on multiple dictionary columns

    During direct generating bloom index for dictionary and date columns, we
    will use MdkKeyGenerator to get the surrogate key. But the
    MdkKeyGenerator is for all MDK, so we need to pad fake bytes to mdk.
    Finally, the generator will only deal with the real parts of the mdk and
    get the final value.
    
    Be sure to do all of the following checklist to help us incorporate 
    your contribution quickly and easily:
    
     - [x] Any interfaces changed?
     `NO`
     - [x] Any backward compatibility impacted?
     `NO`
     - [x] Document update required?
    `NO`
     - [x] Testing done
            Please provide details on 
            - Whether new unit test cases have been added or why no new tests are required?
    `Test modified to cover this problem`
            - How it is tested? Please attach test report.
    `Tested in local machine`
            - Is it a performance related change? Please attach the performance test report.
    `NO`
            - Any additional information to help reviewers in testing this change.
          `NA` 
     - [x] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. 
    `NA`


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

    $ git pull https://github.com/xuchuanyin/carbondata 0815_bug_bloom_dict_write

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

    https://github.com/apache/carbondata/pull/2635.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 #2635
    
----
commit 9a7f9e1eb59320b55eaa833ab9c9ff8135a585fe
Author: xuchuanyin <xu...@...>
Date:   2018-08-15T02:36:48Z

    Fix bug in bloom index on multiple dictionary columns
    
    During direct generating bloom index for dictionary and date columns, we
    will use MdkKeyGenerator to get the surrogate key. But the
    MdkKeyGenerator is for all MDK, so we need to pad fake bytes to mdk.
    Finally, the generator will only deal with the real parts of the mdk and
    get the final value.

----


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8076/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    LGTM


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/18/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8029/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/92/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest this please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6752/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest this please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest this please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8163/



---

[GitHub] carbondata pull request #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bl...

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

    https://github.com/apache/carbondata/pull/2635


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7914/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6638/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6637/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6300/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8084/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest sdv please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6474/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/24/



---

[GitHub] carbondata pull request #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bl...

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

    https://github.com/apache/carbondata/pull/2635#discussion_r213640742
  
    --- Diff: datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomDataMapWriter.java ---
    @@ -91,30 +91,28 @@
       @Override
       protected byte[] convertDictionaryValue(int indexColIdx, Object value) {
         // input value from onPageAdded in load process is byte[]
    -    byte[] fakeMdkBytes;
    -    // this means that we need to pad some fake bytes
    -    // to get the whole MDK in corresponding position
    -    if (columnarSplitter.getBlockKeySize().length > indexCol2MdkIdx.size()) {
    -      int totalSize = 0;
    -      for (int size : columnarSplitter.getBlockKeySize()) {
    -        totalSize += size;
    -      }
    -      fakeMdkBytes = new byte[totalSize];
     
    -      // put this bytes to corresponding position
    -      int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    -      int destPos = 0;
    -      for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    -        if (thisKeyIdx == keyIdx) {
    -          System.arraycopy(value, 0,
    -              fakeMdkBytes, destPos, columnarSplitter.getBlockKeySize()[thisKeyIdx]);
    -          break;
    -        }
    -        destPos += columnarSplitter.getBlockKeySize()[keyIdx];
    +    // This is used to deal with the multiple global dictionary column as index columns.
    +    // The KeyGenerator works with the whole MDK while the value here only represent part of it,
    +    // so we need to pad fake bytes to it in corresponding position.
    +    int totalSize = 0;
    +    for (int size : columnarSplitter.getBlockKeySize()) {
    +      totalSize += size;
    +    }
    +    byte[] fakeMdkBytes = new byte[totalSize];
    +
    +    // put this bytes to corresponding position
    +    int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    +    int destPos = 0;
    +    for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    +      if (thisKeyIdx == keyIdx) {
    +        System.arraycopy(value, 0, fakeMdkBytes, destPos,
    --- End diff --
    
    Please don't  copy, directly convert to int using ` CarbonUtil.getSurrogateInternal(data, startOffsetOfData, columnValueSize)`


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/8059/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    LGTM


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest this please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest sdv please


---

[GitHub] carbondata pull request #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bl...

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

    https://github.com/apache/carbondata/pull/2635#discussion_r213563811
  
    --- Diff: datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomDataMapWriter.java ---
    @@ -91,30 +91,28 @@
       @Override
       protected byte[] convertDictionaryValue(int indexColIdx, Object value) {
         // input value from onPageAdded in load process is byte[]
    -    byte[] fakeMdkBytes;
    -    // this means that we need to pad some fake bytes
    -    // to get the whole MDK in corresponding position
    -    if (columnarSplitter.getBlockKeySize().length > indexCol2MdkIdx.size()) {
    -      int totalSize = 0;
    -      for (int size : columnarSplitter.getBlockKeySize()) {
    -        totalSize += size;
    -      }
    -      fakeMdkBytes = new byte[totalSize];
     
    -      // put this bytes to corresponding position
    -      int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    -      int destPos = 0;
    -      for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    -        if (thisKeyIdx == keyIdx) {
    -          System.arraycopy(value, 0,
    -              fakeMdkBytes, destPos, columnarSplitter.getBlockKeySize()[thisKeyIdx]);
    -          break;
    -        }
    -        destPos += columnarSplitter.getBlockKeySize()[keyIdx];
    +    // This is used to deal with the multiple global dictionary column as index columns.
    +    // The KeyGenerator works with the whole MDK while the value here only represent part of it,
    +    // so we need to pad fake bytes to it in corresponding position.
    +    int totalSize = 0;
    +    for (int size : columnarSplitter.getBlockKeySize()) {
    +      totalSize += size;
    +    }
    +    byte[] fakeMdkBytes = new byte[totalSize];
    +
    +    // put this bytes to corresponding position
    +    int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    +    int destPos = 0;
    +    for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    +      if (thisKeyIdx == keyIdx) {
    +        System.arraycopy(value, 0, fakeMdkBytes, destPos,
    --- End diff --
    
    I am not quite sure about this, please @ravipesala have a look


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6303/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/6267/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    retest this please


---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6782/



---

[GitHub] carbondata issue #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bloom ind...

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

    https://github.com/apache/carbondata/pull/2635
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7913/



---

[GitHub] carbondata pull request #2635: [CARBONDATA-2856][BloomDataMap] Fix bug in bl...

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

    https://github.com/apache/carbondata/pull/2635#discussion_r213897347
  
    --- Diff: datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomDataMapWriter.java ---
    @@ -91,30 +91,28 @@
       @Override
       protected byte[] convertDictionaryValue(int indexColIdx, Object value) {
         // input value from onPageAdded in load process is byte[]
    -    byte[] fakeMdkBytes;
    -    // this means that we need to pad some fake bytes
    -    // to get the whole MDK in corresponding position
    -    if (columnarSplitter.getBlockKeySize().length > indexCol2MdkIdx.size()) {
    -      int totalSize = 0;
    -      for (int size : columnarSplitter.getBlockKeySize()) {
    -        totalSize += size;
    -      }
    -      fakeMdkBytes = new byte[totalSize];
     
    -      // put this bytes to corresponding position
    -      int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    -      int destPos = 0;
    -      for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    -        if (thisKeyIdx == keyIdx) {
    -          System.arraycopy(value, 0,
    -              fakeMdkBytes, destPos, columnarSplitter.getBlockKeySize()[thisKeyIdx]);
    -          break;
    -        }
    -        destPos += columnarSplitter.getBlockKeySize()[keyIdx];
    +    // This is used to deal with the multiple global dictionary column as index columns.
    +    // The KeyGenerator works with the whole MDK while the value here only represent part of it,
    +    // so we need to pad fake bytes to it in corresponding position.
    +    int totalSize = 0;
    +    for (int size : columnarSplitter.getBlockKeySize()) {
    +      totalSize += size;
    +    }
    +    byte[] fakeMdkBytes = new byte[totalSize];
    +
    +    // put this bytes to corresponding position
    +    int thisKeyIdx = indexCol2MdkIdx.get(indexColumns.get(indexColIdx).getColName());
    +    int destPos = 0;
    +    for (int keyIdx = 0; keyIdx < columnarSplitter.getBlockKeySize().length; keyIdx++) {
    +      if (thisKeyIdx == keyIdx) {
    +        System.arraycopy(value, 0, fakeMdkBytes, destPos,
    --- End diff --
    
    nice, it works. :+1: 


---