Search in sources :

Example 1 with DecimalTypeScaled

use of com.bakdata.conquery.models.events.stores.specific.DecimalTypeScaled in project conquery by bakdata.

the class DecimalParser method decideType.

@Override
protected DecimalStore decideType() {
    BigInteger unscaled = DecimalTypeScaled.unscale(maxScale, maxAbs);
    if (unscaled.bitLength() > 63) {
        return DecimalArrayStore.create(getLines());
    }
    IntegerParser sub = new IntegerParser(getConfig());
    sub.setMaxValue(unscaled.longValueExact());
    sub.setMinValue(-unscaled.longValueExact());
    sub.setLines(getLines());
    sub.setNullLines(getNullLines());
    IntegerStore subDecision = sub.findBestType();
    return new DecimalTypeScaled(maxScale, subDecision);
}
Also used : IntegerStore(com.bakdata.conquery.models.events.stores.root.IntegerStore) BigInteger(java.math.BigInteger) DecimalTypeScaled(com.bakdata.conquery.models.events.stores.specific.DecimalTypeScaled)

Aggregations

IntegerStore (com.bakdata.conquery.models.events.stores.root.IntegerStore)1 DecimalTypeScaled (com.bakdata.conquery.models.events.stores.specific.DecimalTypeScaled)1 BigInteger (java.math.BigInteger)1