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

    https://github.com/apache/carbondata/pull/1117#discussion_r125548213
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/page/VarLengthColumnPageBase.java
 ---
    @@ -83,7 +84,59 @@ public void setByteArrayPage(byte[][] byteArray) {
       /**
        * Create a new column page based on the LV (Length Value) encoded bytes
        */
    -  static ColumnPage newDecimalColumnPage(byte[] lvEncodedBytes) throws 
MemoryException {
    +  static ColumnPage newDecimalColumnPage(byte[] lvEncodedBytes, int scale, 
int precision)
    +      throws MemoryException {
    +    DecimalConverterFactory.DecimalConverter decimalConverter =
    +        DecimalConverterFactory.INSTANCE.getDecimalConverter(precision, 
scale);
    +    int size = decimalConverter.getSize();
    +    if (size < 0) {
    +      return getLegacyColumnPage(lvEncodedBytes, scale, precision, 
DataType.DECIMAL);
    +    } else {
    +      // Here the size is always fixed.
    +      return getDecimalColumnPage(lvEncodedBytes, scale, precision, size);
    +    }
    +  }
    +
    +  /**
    +   * Create a new column page based on the LV (Length Value) encoded bytes
    +   */
    +  static ColumnPage newVarLengthColumnPage(byte[] lvEncodedBytes, int 
scale, int precision)
    +      throws MemoryException {
    +    return getLegacyColumnPage(lvEncodedBytes, scale, precision, 
DataType.BYTE_ARRAY);
    --- End diff --
    
    I think it is better to rename `LegacyColumnPage` to 'LVBytesColumnPage`. 
It is hard to know what is legacy


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

Reply via email to