@Override public void deserialize(Block block, int index, DoubleHistogramAggregation.State state) { state.set(new NumericHistogram(VARBINARY.getSlice(block, index), DoubleHistogramAggregation.ENTRY_BUFFER_SIZE)); } }
@Override public void deserialize(Block block, int index, DoubleHistogramAggregation.State state) { state.set(new NumericHistogram(VARBINARY.getSlice(block, index), DoubleHistogramAggregation.ENTRY_BUFFER_SIZE)); } }
@Override public void setField(Block block, int position) { byte[] bytes = VarbinaryType.VARBINARY.getSlice(block, position).getBytes(); value.set(bytes, 0, bytes.length); rowInspector.setStructFieldData(row, field, value); } }
@Override public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(state == State.RUNNING, "Operator is %s", state); Block rowCountBlock = page.getBlock(ROW_COUNT_CHANNEL); Block fragmentBlock = page.getBlock(FRAGMENT_CHANNEL); for (int position = 0; position < page.getPositionCount(); position++) { if (!rowCountBlock.isNull(position)) { rowCount += BIGINT.getLong(rowCountBlock, position); } if (!fragmentBlock.isNull(position)) { fragmentBuilder.add(VARBINARY.getSlice(fragmentBlock, position)); } } extractStatisticsRows(page).ifPresent(statisticsPage -> { OperationTimer timer = new OperationTimer(statisticsCpuTimerEnabled); statisticsAggregationOperator.addInput(statisticsPage); timer.end(statisticsTiming); }); }
@Override public void addInput(Page page) { requireNonNull(page, "page is null"); checkState(state == State.RUNNING, "Operator is %s", state); Block rowCountBlock = page.getBlock(ROW_COUNT_CHANNEL); Block fragmentBlock = page.getBlock(FRAGMENT_CHANNEL); for (int position = 0; position < page.getPositionCount(); position++) { if (!rowCountBlock.isNull(position)) { rowCount += BIGINT.getLong(rowCountBlock, position); } if (!fragmentBlock.isNull(position)) { fragmentBuilder.add(VARBINARY.getSlice(fragmentBlock, position)); } } extractStatisticsRows(page).ifPresent(statisticsPage -> { OperationTimer timer = new OperationTimer(statisticsCpuTimerEnabled); statisticsAggregationOperator.addInput(statisticsPage); timer.end(statisticsTiming); }); }
@Override public void deserialize(Block block, int index, DigestAndPercentileArrayState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); // read number of percentiles int numPercentiles = input.readInt(); ImmutableList.Builder<Double> percentilesListBuilder = ImmutableList.builder(); for (int i = 0; i < numPercentiles; i++) { percentilesListBuilder.add(input.readDouble()); } state.setPercentiles(percentilesListBuilder.build()); // read digest int length = input.readInt(); state.setDigest(new QuantileDigest(input.readSlice(length))); state.addMemoryUsage(state.getDigest().estimatedInMemorySizeInBytes()); } }
@Override public void deserialize(Block block, int index, DigestAndPercentileArrayState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); // read number of percentiles int numPercentiles = input.readInt(); ImmutableList.Builder<Double> percentilesListBuilder = ImmutableList.builder(); for (int i = 0; i < numPercentiles; i++) { percentilesListBuilder.add(input.readDouble()); } state.setPercentiles(percentilesListBuilder.build()); // read digest int length = input.readInt(); state.setDigest(new QuantileDigest(input.readSlice(length))); state.addMemoryUsage(state.getDigest().estimatedInMemorySizeInBytes()); } }
@Override public void deserialize(Block block, int index, LongDecimalWithOverflowState state) { if (!block.isNull(index)) { SliceInput slice = VARBINARY.getSlice(block, index).getInput(); state.setOverflow(slice.readLong()); state.setLongDecimal(Slices.copyOf(slice.readSlice(slice.available()))); } } }
@Override public void deserialize(Block block, int index, LongDecimalWithOverflowState state) { if (!block.isNull(index)) { SliceInput slice = VARBINARY.getSlice(block, index).getInput(); state.setOverflow(slice.readLong()); state.setLongDecimal(Slices.copyOf(slice.readSlice(slice.available()))); } } }
@Override public void deserialize(Block block, int index, DigestAndPercentileState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); // read percentile state.setPercentile(input.readDouble()); // read digest int length = input.readInt(); QuantileDigest digest = new QuantileDigest(input.readSlice(length)); state.setDigest(digest); state.addMemoryUsage(state.getDigest().estimatedInMemorySizeInBytes()); } }
@Override public void deserialize(Block block, int index, LongDecimalWithOverflowAndLongState state) { if (!block.isNull(index)) { SliceInput slice = VARBINARY.getSlice(block, index).getInput(); state.setLong(slice.readLong()); state.setOverflow(slice.readLong()); state.setLongDecimal(Slices.copyOf(slice.readSlice(slice.available()))); } } }
@Override public void deserialize(Block block, int index, LongDecimalWithOverflowAndLongState state) { if (!block.isNull(index)) { SliceInput slice = VARBINARY.getSlice(block, index).getInput(); state.setLong(slice.readLong()); state.setOverflow(slice.readLong()); state.setLongDecimal(Slices.copyOf(slice.readSlice(slice.available()))); } } }
@Override public void deserialize(Block block, int index, DigestAndPercentileState state) { SliceInput input = VARBINARY.getSlice(block, index).getInput(); // read percentile state.setPercentile(input.readDouble()); // read digest int length = input.readInt(); QuantileDigest digest = new QuantileDigest(input.readSlice(length)); state.setDigest(digest); state.addMemoryUsage(state.getDigest().estimatedInMemorySizeInBytes()); } }