KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > execute > DistinctGroupedAggregateResultSet


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.execute.DistinctGroupedAggregateResultSet
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.execute;
23
24 import org.apache.derby.iapi.services.monitor.Monitor;
25
26 import org.apache.derby.iapi.services.sanity.SanityManager;
27
28 import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
29 import org.apache.derby.iapi.services.stream.InfoStreams;
30
31 import org.apache.derby.iapi.services.io.Formatable;
32
33 import org.apache.derby.iapi.sql.execute.CursorResultSet;
34 import org.apache.derby.iapi.sql.ResultSet;
35 import org.apache.derby.iapi.sql.execute.ExecIndexRow;
36 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
37
38 import org.apache.derby.iapi.sql.Activation;
39
40 import org.apache.derby.iapi.store.access.ColumnOrdering;
41 import org.apache.derby.iapi.store.access.TransactionController;
42 import org.apache.derby.iapi.store.access.ScanController;
43
44 import org.apache.derby.iapi.services.loader.GeneratedMethod;
45
46 import org.apache.derby.iapi.sql.execute.ExecutionContext;
47 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
48
49 import org.apache.derby.iapi.types.RowLocation;
50
51 import org.apache.derby.iapi.error.StandardException;
52
53 import java.util.Properties JavaDoc;
54 import java.util.Vector JavaDoc;
55 import java.util.Enumeration JavaDoc;
56
57 /**
58  * This ResultSet evaluates grouped aggregates when there is 1 or more distinct aggregate.
59  * It will scan the entire source result set and calculate
60  * the grouped aggregates when scanning the source during the
61  * first call to next().
62  *
63  * RESOLVE - This subclass is essentially empty. Someday we will need to write
64  * additional code for distinct grouped aggregates, especially when we support
65  * multiple distinct aggregates.
66  *
67  * @author jerry (broken out from SortResultSet)
68  */

69 class DistinctGroupedAggregateResultSet extends GroupedAggregateResultSet
70 {
71
72     /**
73      * Constructor
74      *
75      * @param s input result set
76      * @param isInSortedOrder true if the source results are in sorted order
77      * @param aggregateItem indicates the number of the
78      * SavedObject off of the PreparedStatement that holds the
79      * AggregatorInfoList used by this routine.
80      * @param orderingItem indicates the number of the
81      * SavedObject off of the PreparedStatement that holds the
82      * ColumOrdering array used by this routine
83      * @param a activation
84      * @param ra generated method to build an empty
85      * output row
86      * @param maxRowSize approx row size, passed to sorter
87      * @param resultSetNumber The resultSetNumber for this result set
88      *
89      * @exception StandardException Thrown on error
90      */

91     DistinctGroupedAggregateResultSet(NoPutResultSet s,
92                     boolean isInSortedOrder,
93                     int aggregateItem,
94                     int orderingItem,
95                     Activation a,
96                     GeneratedMethod ra,
97                     int maxRowSize,
98                     int resultSetNumber,
99                     double optimizerEstimatedRowCount,
100                     double optimizerEstimatedCost) throws StandardException
101     {
102         super(s, isInSortedOrder, aggregateItem, orderingItem,
103               a, ra, maxRowSize, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);
104     }
105
106
107     ///////////////////////////////////////////////////////////////////////////////
108
//
109
// ResultSet interface (leftover from NoPutResultSet)
110
//
111
///////////////////////////////////////////////////////////////////////////////
112

113     ///////////////////////////////////////////////////////////////////////////////
114
//
115
// CursorResultSet interface
116
//
117
///////////////////////////////////////////////////////////////////////////////
118

119     ///////////////////////////////////////////////////////////////////////////////
120
//
121
// SCAN ABSTRACTION UTILITIES
122
//
123
///////////////////////////////////////////////////////////////////////////////
124

125     ///////////////////////////////////////////////////////////////////////////////
126
//
127
// AGGREGATION UTILITIES
128
//
129
///////////////////////////////////////////////////////////////////////////////
130
}
131
Popular Tags