Package org.apache.phoenix.schema.tuple

Examples of org.apache.phoenix.schema.tuple.Tuple


    private PeekingResultIterator currentIterator() throws SQLException {
        List<PeekingResultIterator> iterators = getIterators();
        while (index < iterators.size()) {
            PeekingResultIterator iterator = iterators.get(index);
            Tuple r = iterator.peek();
            if (r != null) {
                return iterator;
            }
            iterator.close();
            index++;
View Full Code Here


    @Override
    public Tuple next() throws SQLException {
        Iterator<ResultEntry> iterator = getResultIterator();
        if (iterator.hasNext()) {
            ResultEntry entry = iterator.next();
            Tuple tuple = entry.getResult();
            aggregate(tuple);
            return tuple;
        }
        resultIterator = Iterators.emptyIterator();
        return null;
View Full Code Here

            return current != null;
        }

        @Override
        public Tuple next() {
            Tuple next = nextOrNull();
            if (next == null) {
                throw new NoSuchElementException();
            }
            return next;
        }
View Full Code Here

        public Tuple nextOrNull() {
            if (current == null) {
                return null;
            }
            Tuple next = current;
            advance();
            return next;
        }
View Full Code Here

        super(resultIterator, aggregators);
    }
   
    @Override
    public Tuple next() throws SQLException {
        Tuple result = super.next();
        // Ensure ungrouped aggregregation always returns a row, even if the underlying iterator doesn't.
        if (result == null && !hasRows) {
            // Generate value using unused ClientAggregators
            byte[] value = aggregators.toBytes(aggregators.getAggregators());
            result = new SingleKeyValueTuple(
View Full Code Here

    }
   
    @Override
    public Tuple next() throws SQLException {
        init();
        Tuple next = this.next;
        this.next = advance();
        return next;
    }
View Full Code Here

        }
    }

    @Override
    public Tuple next() throws SQLException {
        Tuple next;
        do {
            next = delegate.next();
        } while (next != null && expression.evaluate(next, ptr) && Boolean.FALSE.equals(expression.getDataType().toObject(ptr)));
        return next;
    }
View Full Code Here

        @Override
        public Tuple next() throws SQLException {
            if (chunkComplete || lastKey == null) {
                return null;
            }
            Tuple next = delegate.next();
            if (next != null) {
                // We actually keep going past the chunk size until the row key changes. This is
                // necessary for (at least) hash joins, as they can return multiple rows with the
                // same row key. Stopping a chunk at a row key boundary is necessary in order to
                // be able to start the next chunk on the next row key
                if (rowCount == chunkSize) {
                    next.getKey(lastKey);
                } else if (rowCount > chunkSize && rowKeyChanged(next)) {
                    chunkComplete = true;
                    return null;
                }
                rowCount++;
View Full Code Here

        }
    }

    @Override
    protected Tuple advance() throws SQLException {
        Tuple next;
        do {
            next = delegate.next();
        } while (next != null && expression.evaluate(next, ptr) && Boolean.FALSE.equals(expression.getDataType().toObject(ptr)));
        return next;
    }
View Full Code Here

        public PhoenixResultSet executeQuery() throws SQLException {
            StatementPlan plan = getStatement().optimizePlan();
            List<String> planSteps = plan.getExplainPlan().getPlanSteps();
            List<Tuple> tuples = Lists.newArrayListWithExpectedSize(planSteps.size());
            for (String planStep : planSteps) {
                Tuple tuple = new SingleKeyValueTuple(KeyValueUtil.newKeyValue(PDataType.VARCHAR.toBytes(planStep), EXPLAIN_PLAN_FAMILY, EXPLAIN_PLAN_COLUMN, MetaDataProtocol.MIN_TABLE_TIMESTAMP, ByteUtil.EMPTY_BYTE_ARRAY));
                tuples.add(tuple);
            }
            Scanner scanner = new WrappedScanner(new MaterializedResultIterator(tuples),EXPLAIN_PLAN_ROW_PROJECTOR);
            PhoenixResultSet rs = new PhoenixResultSet(scanner, new PhoenixStatement(connection));
            lastResultSet = rs;
View Full Code Here

TOP

Related Classes of org.apache.phoenix.schema.tuple.Tuple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.