Package com.illumon.iris.db.tables.utils
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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BigDecimalUtils.PrecisionAndScale
Immutable way to store and pass precision and scale values. -
Constructor Summary
Constructors Constructor Description BigDecimalUtils()
-
Method Summary
Modifier and Type Method Description static BigDecimalUtils.PrecisionAndScale
computePrecisionAndScale(Table t, String colName)
Compute an overall precision and scale that would fit all existing values in a table.static BigDecimalUtils.PrecisionAndScale
computePrecisionAndScale(Index rowSet, ColumnSource<BigDecimal> source)
Compute an overall precision and scale that would fit all existing values in a column source.
-
Constructor Details
-
BigDecimalUtils
public BigDecimalUtils()
-
-
Method Details
-
computePrecisionAndScale
Compute an overall precision and scale that would fit all existing values in a table.- Parameters:
t
- a Deephaven tablecolName
- a Column fort
, which should be ofBigDecimal
type- Returns:
- a
PrecisionAndScale
object result.
-
computePrecisionAndScale
public static BigDecimalUtils.PrecisionAndScale computePrecisionAndScale(Index rowSet, 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 columnsource
- aColumnSource
ofBigDecimal
type- Returns:
- a
PrecisionAndScale
object result.
-