Class BigDecimalUtils

java.lang.Object
com.illumon.iris.db.tables.utils.BigDecimalUtils

public class BigDecimalUtils extends Object
Utilities to support BigDecimal exhaust. Parquet decimal types make a whole column decimal type have a fixed precision and scale; BigDecimal columns in Deephaven are, each value, arbitrary precision (its own precision and scale). For static tables, it is possible to compute overall precision and scale values that fit every existing value. For refreshing tables, we need the user to tell us.
  • Constructor Details

    • BigDecimalUtils

      public BigDecimalUtils()
  • Method Details

    • computePrecisionAndScale

      public static BigDecimalUtils.PrecisionAndScale computePrecisionAndScale(Table t, String colName)
      Compute an overall precision and scale that would fit all existing values in a table.
      Parameters:
      t - a Deephaven table
      colName - a Column for t, which should be of BigDecimal type
      Returns:
      a PrecisionAndScale object result.
    • computePrecisionAndScale

      public static BigDecimalUtils.PrecisionAndScale computePrecisionAndScale(@NotNull ReadOnlyIndex rowSet, @NotNull ColumnSource<BigDecimal> source)
      Compute an overall precision and scale that would fit all existing values in a column source.
      Parameters:
      rowSet - The rowset for the provided column
      source - a ColumnSource of BigDecimal type
      Returns:
      a PrecisionAndScale object result.