001: /*
002:
003: Derby - Class org.apache.derby.impl.sql.execute.DistinctGroupedAggregateResultSet
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to you under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.impl.sql.execute;
023:
024: import org.apache.derby.iapi.services.monitor.Monitor;
025:
026: import org.apache.derby.iapi.services.sanity.SanityManager;
027:
028: import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
029: import org.apache.derby.iapi.services.stream.InfoStreams;
030:
031: import org.apache.derby.iapi.services.io.Formatable;
032:
033: import org.apache.derby.iapi.sql.execute.CursorResultSet;
034: import org.apache.derby.iapi.sql.ResultSet;
035: import org.apache.derby.iapi.sql.execute.ExecIndexRow;
036: import org.apache.derby.iapi.sql.execute.NoPutResultSet;
037:
038: import org.apache.derby.iapi.sql.Activation;
039:
040: import org.apache.derby.iapi.store.access.ColumnOrdering;
041: import org.apache.derby.iapi.store.access.TransactionController;
042: import org.apache.derby.iapi.store.access.ScanController;
043:
044: import org.apache.derby.iapi.services.loader.GeneratedMethod;
045:
046: import org.apache.derby.iapi.sql.execute.ExecutionContext;
047: import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
048:
049: import org.apache.derby.iapi.types.RowLocation;
050:
051: import org.apache.derby.iapi.error.StandardException;
052:
053: import java.util.Properties;
054: import java.util.Vector;
055: import java.util.Enumeration;
056:
057: /**
058: * This ResultSet evaluates grouped aggregates when there is 1 or more distinct aggregate.
059: * It will scan the entire source result set and calculate
060: * the grouped aggregates when scanning the source during the
061: * first call to next().
062: *
063: * RESOLVE - This subclass is essentially empty. Someday we will need to write
064: * additional code for distinct grouped aggregates, especially when we support
065: * multiple distinct aggregates.
066: *
067: * @author jerry (broken out from SortResultSet)
068: */
069: class DistinctGroupedAggregateResultSet extends
070: GroupedAggregateResultSet {
071:
072: /**
073: * Constructor
074: *
075: * @param s input result set
076: * @param isInSortedOrder true if the source results are in sorted order
077: * @param aggregateItem indicates the number of the
078: * SavedObject off of the PreparedStatement that holds the
079: * AggregatorInfoList used by this routine.
080: * @param orderingItem indicates the number of the
081: * SavedObject off of the PreparedStatement that holds the
082: * ColumOrdering array used by this routine
083: * @param a activation
084: * @param ra generated method to build an empty
085: * output row
086: * @param maxRowSize approx row size, passed to sorter
087: * @param resultSetNumber The resultSetNumber for this result set
088: *
089: * @exception StandardException Thrown on error
090: */
091: DistinctGroupedAggregateResultSet(NoPutResultSet s,
092: boolean isInSortedOrder, int aggregateItem,
093: int orderingItem, Activation a, GeneratedMethod ra,
094: int maxRowSize, int resultSetNumber,
095: double optimizerEstimatedRowCount,
096: double optimizerEstimatedCost) throws StandardException {
097: super (s, isInSortedOrder, aggregateItem, orderingItem, a, ra,
098: maxRowSize, resultSetNumber,
099: optimizerEstimatedRowCount, optimizerEstimatedCost);
100: }
101:
102: ///////////////////////////////////////////////////////////////////////////////
103: //
104: // ResultSet interface (leftover from NoPutResultSet)
105: //
106: ///////////////////////////////////////////////////////////////////////////////
107:
108: ///////////////////////////////////////////////////////////////////////////////
109: //
110: // CursorResultSet interface
111: //
112: ///////////////////////////////////////////////////////////////////////////////
113:
114: ///////////////////////////////////////////////////////////////////////////////
115: //
116: // SCAN ABSTRACTION UTILITIES
117: //
118: ///////////////////////////////////////////////////////////////////////////////
119:
120: ///////////////////////////////////////////////////////////////////////////////
121: //
122: // AGGREGATION UTILITIES
123: //
124: ///////////////////////////////////////////////////////////////////////////////
125: }
|