Package org.apache.hadoop.hbase.hbql.statement

Examples of org.apache.hadoop.hbase.hbql.statement.SelectStatement


    @SuppressWarnings("unchecked")
    protected T fetchNextObject() throws HBqlException {

        final HResultSetImpl<T, R> rs = this.getResultSet();
        final SelectStatement selectStatement = rs.getSelectStmt();
        final ResultAccessor resultAccessor = selectStatement.getMappingContext().getResultAccessor();

        while (this.getCurrentResultIterator() != null || moreResultsPending()) {

            if (this.getCurrentResultIterator() == null)
                this.setCurrentResultIterator(this.getNextResultIterator());

            while (this.getCurrentResultIterator() != null
                   && this.getCurrentResultIterator().hasNext()) {

                final Result result = this.getCurrentResultIterator().next();

                try {
                    if (rs.getClientExpressionTree() != null
                        && !rs.getClientExpressionTree().evaluate(rs.getHConnectionImpl(), result))
                        continue;
                }
                catch (ResultMissingColumnException e) {
                    continue;
                }
                catch (NullColumnValueException e) {
                    continue;
                }

                this.incrementReturnedRecordCount();

                if (selectStatement.isAnAggregateQuery()) {
                    this.getResultSet().getAggregateRecord().applyValues(result);
                }
                else {
                    final T val = (T)resultAccessor.newObject(rs.getHConnectionImpl(),
                                                              selectStatement.getMappingContext(),
                                                              selectStatement.getSelectElementList(),
                                                              rs.getMaxVersions(),
                                                              result);

                    return rs.getQuery().callOnEachRow(val);
                }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hbql.statement.SelectStatement

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.