Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1297#discussion_r137273402
--- Diff:
core/src/main/java/org/apache/carbondata/core/datastore/page/SafeFixLengthColumnPage.java
---
@@ -165,9 +165,28 @@ public double getDouble(int rowId) {
return doubleData[rowId];
}
- @Override
- public BigDecimal getDecimal(int rowId) {
- throw new UnsupportedOperationException("invalid data type: " +
dataType);
+ @Override public BigDecimal getDecimal(int rowId) {
--- End diff --
I think adding converter inside the column page make it a bit complex. I
think there are two mays to make the code clean:
1. Store BigDecimal array in the ColumnPage and do the conversion to int or
long when come to encoding part, by implementing a ColumnPageValueConverter
2. Create DecimalColumnPage class and add the conversion logic in
DecimalColumnPage. This logic is the extra logic for decimal only. If you do
like this, we can consider to rename `FixLengthColumnPage` to
`PrimitiveColumnPage` and `VarLengthColumnPage` to `StringColumnPage` and the
3rd one is `DecimalColumnPage`. The responsibility of each class will be more
clear.
---