@Override public Double visit(LiteralResultIterationPlan plan) { return (double) plan.getEstimatedSize(); }
private QueryPlan newLiteralResultIterationPlan(Integer offset, Integer limit) throws SQLException { List<Tuple> tuples = Lists.newArrayList(); Tuple baseTuple = new SingleKeyValueTuple(KeyValue.LOWESTKEY); for (Object[] row : RELATION) { Expression[] exprs = new Expression[row.length]; for (int i = 0; i < row.length; i++) { exprs[i] = LiteralExpression.newConstant(row[i]); } TupleProjector projector = new TupleProjector(exprs); tuples.add(projector.projectResults(baseTuple)); } return new LiteralResultIterationPlan(tuples, CONTEXT, SelectStatement.SELECT_ONE, TableRef.EMPTY_TABLE_REF, RowProjector.EMPTY_PROJECTOR, limit, offset, OrderBy.EMPTY_ORDER_BY, null); }
private QueryPlan newLiteralResultIterationPlan(Object[][] rows, Integer offset) throws SQLException { List<Tuple> tuples = Lists.newArrayList(); Tuple baseTuple = new SingleKeyValueTuple(KeyValue.LOWESTKEY); for (Object[] row : rows) { Expression[] exprs = new Expression[row.length]; for (int i = 0; i < row.length; i++) { exprs[i] = LiteralExpression.newConstant(row[i]); } TupleProjector projector = new TupleProjector(exprs); tuples.add(projector.projectResults(baseTuple)); } return new LiteralResultIterationPlan(tuples, CONTEXT, SelectStatement.SELECT_ONE, TableRef.EMPTY_TABLE_REF, RowProjector.EMPTY_PROJECTOR, null, offset, OrderBy.EMPTY_ORDER_BY, null); }
ParallelIteratorFactory parallelIteratorFactory = asSubquery ? null : this.parallelIteratorFactory; plan = select.getFrom() == null ? new LiteralResultIterationPlan(context, select, tableRef, projector, limit, offset, orderBy, parallelIteratorFactory) : (select.isAggregate() || select.isDistinct()
@Override public Double visit(LiteralResultIterationPlan plan) { return (double) plan.getEstimatedSize(); }
private void testUnnestArrays(PArrayDataType arrayType, List<Object[]> arrays, boolean withOrdinality) throws Exception { PDataType baseType = PDataType.fromTypeId(arrayType.getSqlType() - PDataType.ARRAY_TYPE_BASE); List<Tuple> tuples = toTuples(arrayType, arrays); LiteralResultIterationPlan subPlan = new LiteralResultIterationPlan(tuples, CONTEXT, SelectStatement.SELECT_ONE, TableRef.EMPTY_TABLE_REF, RowProjector.EMPTY_PROJECTOR, null, null, OrderBy.EMPTY_ORDER_BY, null); LiteralExpression dummy = LiteralExpression.newConstant(null, arrayType);
@Override public Double visit(LiteralResultIterationPlan plan) { return (double) plan.getEstimatedSize(); }
ParallelIteratorFactory parallelIteratorFactory = asSubquery ? null : this.parallelIteratorFactory; if(select.getFrom() == null) { plan = new LiteralResultIterationPlan(context, select, tableRef, projector, limit, offset, orderBy, parallelIteratorFactory); } else {
ParallelIteratorFactory parallelIteratorFactory = asSubquery ? null : this.parallelIteratorFactory; plan = select.getFrom() == null ? new LiteralResultIterationPlan(context, select, tableRef, projector, limit, offset, orderBy, parallelIteratorFactory) : (select.isAggregate() || select.isDistinct()