double maxInd = adjustedIndexMap.get(list.get(list.size() - 1).getKey()); double lowValue = 0; double min = MetaStoreServerUtils.decimalToDouble(list.get(0).getValue().getLowValue()); double max = MetaStoreServerUtils.decimalToDouble(list.get(list.size() - 1).getValue().getLowValue()); if (minInd == maxInd) { lowValue = min; maxInd = adjustedIndexMap.get(list.get(list.size() - 1).getKey()); double highValue = 0; min = MetaStoreServerUtils.decimalToDouble(list.get(0).getValue().getHighValue()); max = MetaStoreServerUtils.decimalToDouble(list.get(list.size() - 1).getValue().getHighValue()); if (minInd == maxInd) { highValue = min;
lowerBound = Math.max(lowerBound, newData.getNumDVs()); higherBound += newData.getNumDVs(); densityAvgSum += (MetaStoreServerUtils.decimalToDouble(newData.getHighValue()) - MetaStoreServerUtils .decimalToDouble(newData.getLowValue())) / newData.getNumDVs(); if (ndvEstimator != null) { ndvEstimator.mergeEstimators(newData.getNdvEstimator()); aggregateData = newData.deepCopy(); } else { if (MetaStoreServerUtils.decimalToDouble(aggregateData.getLowValue()) < MetaStoreServerUtils .decimalToDouble(newData.getLowValue())) { aggregateData.setLowValue(aggregateData.getLowValue()); } else { aggregateData.setLowValue(newData.getLowValue()); if (MetaStoreServerUtils.decimalToDouble(aggregateData.getHighValue()) > MetaStoreServerUtils .decimalToDouble(newData.getHighValue())) { aggregateData.setHighValue(aggregateData.getHighValue()); } else { estimation = (long) ((MetaStoreServerUtils.decimalToDouble(aggregateData.getHighValue()) - MetaStoreServerUtils .decimalToDouble(aggregateData.getLowValue())) / densityAvg); if (estimation < lowerBound) { estimation = lowerBound; DecimalColumnStatsData newData = cso.getStatsData().getDecimalStats(); if (useDensityFunctionForNDVEstimation) { densityAvgSum += (MetaStoreServerUtils.decimalToDouble(newData.getHighValue()) - MetaStoreServerUtils .decimalToDouble(newData.getLowValue())) / newData.getNumDVs();