public Operator createAlignmentOperator( OperatorContext operatorContext, List<ConnectorColumnHandle> columns, RaptorSplit raptorSplit) { ImmutableList.Builder<Type> types = ImmutableList.builder(); ImmutableList.Builder<Iterable<Block>> channels = ImmutableList.builder(); for (ConnectorColumnHandle column : columns) { RaptorColumnHandle raptorColumnHandle = checkType(column, RaptorColumnHandle.class, "column"); types.add(raptorColumnHandle.getColumnType()); channels.add(storageManager.getBlocks(raptorSplit.getShardUuid(), column)); } return new AlignmentOperator(operatorContext, types.build(), channels.build()); }
public Operator createNoColumnsOperator( OperatorContext operatorContext, RaptorSplit raptorSplit) { RaptorColumnHandle countColumnHandle = raptorSplit.getCountColumnHandle(); Iterable<Block> blocks = storageManager.getBlocks(raptorSplit.getShardUuid(), countColumnHandle); return new NoColumnsOperator( operatorContext, Iterables.transform( blocks, new Function<Block, Integer>() { @Override public Integer apply(Block input) { return input.getPositionCount(); } })); }