Hi dev,
Any one knows why the decimal type in compaction flow is processed as below
in CarbonFactDataHandlerColumnar  ?
I can't understand according to the comments.

// convert measure columns
for (int i = 0; i < type.length; i++) {
  Object value = rows[i];

  // in compaction flow the measure with decimal type will come as
spark decimal.
  // need to convert it to byte array.
  if (type[i] == DataType.DECIMAL && compactionFlow) {
    BigDecimal bigDecimal = ((Decimal) rows[i]).toJavaBigDecimal();
    value = DataTypeUtil.bigDecimalToByte(bigDecimal);
  }
  measurePage[i].putData(rowId, value);
}


Thanks!
Lionel

Reply via email to