Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/576#discussion_r98163965
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/NumberCompressor.java
 ---
    @@ -137,12 +161,31 @@ public NumberCompressor(int cardinality) {
         return words;
       }
     
    +  //  public int[] unCompress(byte[] key, int offset, int length) {
    +  //    int ls = length;
    +  //    int arrayLength = (ls * BYTE_LENGTH) / bitsLength;
    +  //    long[] words = new long[getWordsSizeFromBytesSize(ls)];
    +  //    unCompressVal(key, ls, words, offset);
    +  //    return getArray(words, arrayLength);
    +  //  }
    +
       public int[] unCompress(byte[] key, int offset, int length) {
    -    int ls = length;
    -    int arrayLength = (ls * BYTE_LENGTH) / bitsLength;
    -    long[] words = new long[getWordsSizeFromBytesSize(ls)];
    -    unCompressVal(key, ls, words, offset);
    -    return getArray(words, arrayLength);
    +    int len = length / bytesPerKey;
    +    if (length % bytesPerKey != 0) {
    +      throw new IllegalArgumentException(
    +          "Some thing wrong while decompress" + length + " " + 
bytesPerKey);
    --- End diff --
    
    Both length is read from footer, right? If comes here, mean the file is 
corrupted.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to