public CursorFetchPlan(QueryPlan cursorQueryPlan,String cursorName) { super(cursorQueryPlan); this.isAggregate = delegate.getStatement().isAggregate() || delegate.getStatement().isDistinct(); this.cursorName = cursorName; }
planSteps.add("CLIENT AFTER-AGGREGATION FILTER BY " + having.toString()); if (statement.isDistinct() && statement.isAggregate()) { planSteps.add("CLIENT DISTINCT ON " + projector.toString());
/** * The method validates the statement passed to the query plan. List of conditions are * <ol> * <li>Is a SELECT statement</li> * <li>doesn't contain ORDER BY expression</li> * <li>doesn't contain LIMIT</li> * <li>doesn't contain GROUP BY expression</li> * <li>doesn't contain DISTINCT</li> * <li>doesn't contain AGGREGATE functions</li> * </ol> * @param queryPlan * @return */ private boolean isValidStatement(final QueryPlan queryPlan) { if(queryPlan.getStatement().getOperation() != PhoenixStatement.Operation.QUERY) { throw new IllegalArgumentException("Query passed isn't a SELECT statement"); } if(!queryPlan.getOrderBy().getOrderByExpressions().isEmpty() || queryPlan.getLimit() != null || (queryPlan.getGroupBy() != null && !queryPlan.getGroupBy().isEmpty()) || queryPlan.getStatement().isDistinct() || queryPlan.getStatement().isAggregate()) { throw new IllegalArgumentException("SELECT statement shouldn't contain DISTINCT or ORDER BY or LIMIT or GROUP BY expressions"); } return true; }
if (!statement.isAggregate() && filteredColumnNotInProjection) { ScanUtil.andFilterAtEnd(scan, trackedColumnsBitset != null ? new EncodedQualifiersColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table), trackedColumnsBitset, conditionOnlyCfs, table.getEncodingScheme()) : new ColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table),
if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());
if (scanRanges == ScanRanges.NOTHING && !getStatement().isAggregate()) { return getWrappedIterator(caches, ResultIterator.EMPTY_ITERATOR);
&& ( ( statement.isDistinct() && ! statement.isAggregate() ) || ( ! statement.isDistinct() && ( context.getAggregationManager().isEmpty() || BaseScannerRegionObserver.KEY_ORDERED_GROUP_BY_EXPRESSIONS.equals(groupBy.getScanAttribName()) ) ) ) ) { if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());
public CursorFetchPlan(QueryPlan cursorQueryPlan,String cursorName) { super(cursorQueryPlan); this.isAggregate = delegate.getStatement().isAggregate() || delegate.getStatement().isDistinct(); this.cursorName = cursorName; }
public CursorFetchPlan(QueryPlan cursorQueryPlan,String cursorName) { super(cursorQueryPlan); this.isAggregate = delegate.getStatement().isAggregate() || delegate.getStatement().isDistinct(); this.cursorName = cursorName; }
planSteps.add("CLIENT AFTER-AGGREGATION FILTER BY " + having.toString()); if (statement.isDistinct() && statement.isAggregate()) { planSteps.add("CLIENT DISTINCT ON " + projector.toString());
planSteps.add("CLIENT AFTER-AGGREGATION FILTER BY " + having.toString()); if (statement.isDistinct() && statement.isAggregate()) { planSteps.add("CLIENT DISTINCT ON " + projector.toString());
/** * The method validates the statement passed to the query plan. List of conditions are * <ol> * <li>Is a SELECT statement</li> * <li>doesn't contain ORDER BY expression</li> * <li>doesn't contain LIMIT</li> * <li>doesn't contain GROUP BY expression</li> * <li>doesn't contain DISTINCT</li> * <li>doesn't contain AGGREGATE functions</li> * </ol> * @param queryPlan * @return */ private boolean isValidStatement(final QueryPlan queryPlan) { if(queryPlan.getStatement().getOperation() != PhoenixStatement.Operation.QUERY) { throw new IllegalArgumentException("Query passed isn't a SELECT statement"); } if(!queryPlan.getOrderBy().getOrderByExpressions().isEmpty() || queryPlan.getLimit() != null || (queryPlan.getGroupBy() != null && !queryPlan.getGroupBy().isEmpty()) || queryPlan.getStatement().isDistinct() || queryPlan.getStatement().isAggregate()) { throw new IllegalArgumentException("SELECT statement shouldn't contain DISTINCT or ORDER BY or LIMIT or GROUP BY expressions"); } return true; }
if (!statement.isAggregate() && filteredColumnNotInProjection) { ScanUtil.andFilterAtEnd(scan, trackedColumnsBitset != null ? new EncodedQualifiersColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table), trackedColumnsBitset, conditionOnlyCfs, table.getEncodingScheme()) : new ColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table),
if (!statement.isAggregate() && filteredColumnNotInProjection) { ScanUtil.andFilterAtEnd(scan, trackedColumnsBitset != null ? new EncodedQualifiersColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table), trackedColumnsBitset, conditionOnlyCfs, table.getEncodingScheme()) : new ColumnProjectionFilter(SchemaUtil.getEmptyColumnFamily(table),
if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());
if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());
if (scanRanges == ScanRanges.NOTHING && !getStatement().isAggregate()) { return getWrappedIterator(caches, ResultIterator.EMPTY_ITERATOR);
if (scanRanges == ScanRanges.NOTHING && !getStatement().isAggregate()) { return getWrappedIterator(caches, ResultIterator.EMPTY_ITERATOR);
&& ( ( statement.isDistinct() && ! statement.isAggregate() ) || ( ! statement.isDistinct() && ( context.getAggregationManager().isEmpty() || BaseScannerRegionObserver.KEY_ORDERED_GROUP_BY_EXPRESSIONS.equals(groupBy.getScanAttribName()) ) ) ) ) { if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());
&& ( ( statement.isDistinct() && ! statement.isAggregate() ) || ( ! statement.isDistinct() && ( context.getAggregationManager().isEmpty() || BaseScannerRegionObserver.KEY_ORDERED_GROUP_BY_EXPRESSIONS.equals(groupBy.getScanAttribName()) ) ) ) ) { if (statement.isDistinct() && statement.isAggregate()) { // Dedup on client if select distinct and aggregation aggResultIterator = new DistinctAggregatingResultIterator(aggResultIterator, getProjector());