/** * Checks if the HT reduces the number of entries by at least minReductionHashAggr factor * @throws HiveException */ private void checkHashModeEfficiency() throws HiveException { if (lastModeCheckRowCount > numRowsCompareHashAggr) { lastModeCheckRowCount = 0; if (LOG.isDebugEnabled()) { LOG.debug(String.format("checkHashModeEfficiency: HT:%d RC:%d MIN:%d", numEntriesHashTable, sumBatchSize, (long)(sumBatchSize * minReductionHashAggr))); } if (numEntriesHashTable > sumBatchSize * minReductionHashAggr) { flush(true); changeToStreamingMode(); } } } }
/** * Checks if the HT reduces the number of entries by at least minReductionHashAggr factor * @throws HiveException */ private void checkHashModeEfficiency() throws HiveException { if (lastModeCheckRowCount > numRowsCompareHashAggr) { lastModeCheckRowCount = 0; if (LOG.isDebugEnabled()) { LOG.debug(String.format("checkHashModeEfficiency: HT:%d RC:%d MIN:%d", numEntriesHashTable, sumBatchSize, (long)(sumBatchSize * minReductionHashAggr))); } if (numEntriesHashTable > sumBatchSize * minReductionHashAggr) { flush(true); changeToStreamingMode(); } } } }
flush(false);
/** * Checks if the HT reduces the number of entries by at least minReductionHashAggr factor * @throws HiveException */ private void checkHashModeEfficiency() throws HiveException { if (lastModeCheckRowCount > numRowsCompareHashAggr) { lastModeCheckRowCount = 0; if (LOG.isDebugEnabled()) { LOG.debug(String.format("checkHashModeEfficiency: HT:%d RC:%d MIN:%d", numEntriesHashTable, sumBatchSize, (long)(sumBatchSize * minReductionHashAggr))); } if (numEntriesHashTable > sumBatchSize * minReductionHashAggr) { flush(true); changeToUnsortedStreamingMode(); } } } }
@Override public void close(boolean aborted) throws HiveException { if (!aborted) { flush(true); } }
flush(false);
@Override public void close(boolean aborted) throws HiveException { if (!aborted) { flush(true); } if (!aborted && sumBatchSize == 0 && GroupByOperator.shouldEmitSummaryRow(conf)) { // in case the empty grouping set is preset; but no output has done // the "summary row" still needs to be emitted VectorHashKeyWrapperBase kw = keyWrappersBatch.getVectorHashKeyWrappers()[0]; kw.setNull(); int pos = conf.getGroupingSetPosition(); if (pos >= 0) { long val = (1L << pos) - 1; keyWrappersBatch.setLongValue(kw, pos, val); } VectorAggregationBufferRow groupAggregators = allocateAggregationBuffer(); writeSingleRow(kw, groupAggregators); } }
@Override public void close(boolean aborted) throws HiveException { if (!aborted) { flush(true); } }