Source code: org/apache/derby/iapi/sql/execute/ResultSetFactory.java
1 /*
2
3 Derby - Class org.apache.derby.iapi.sql.execute.ResultSetFactory
4
5 Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19 */
20
21 package org.apache.derby.iapi.sql.execute;
22
23 import org.apache.derby.iapi.error.StandardException;
24
25 import org.apache.derby.iapi.sql.ResultDescription;
26 import org.apache.derby.iapi.sql.ResultSet;
27 import org.apache.derby.iapi.sql.Activation;
28
29 import org.apache.derby.iapi.services.loader.GeneratedMethod;
30
31 import org.apache.derby.iapi.store.access.Qualifier;
32
33 /**
34 * ResultSetFactory provides a wrapper around all of
35 * the result sets needed in an execution implementation.
36 * <p>
37 * For the activations to avoid searching for this module
38 * in their execute methods, the base activation supertype
39 * should implement a method that does the lookup and salts
40 * away this factory for the activation to use as it needs it.
41 *
42 * @author ames
43 */
44 public interface ResultSetFactory {
45 /**
46 Module name for the monitor's module locating system.
47 */
48 String MODULE = "org.apache.derby.iapi.sql.execute.ResultSetFactory";
49
50 //
51 // DDL operations
52 //
53
54 /**
55 Generic DDL result set creation.
56
57 @param activation the activation for this result set
58
59 @return ResultSet A wrapper result set to run the Execution-time
60 logic.
61 @exception StandardException thrown when unable to create the
62 result set
63 */
64 ResultSet getDDLResultSet(Activation activation)
65 throws StandardException;
66
67
68 //
69 // MISC operations
70 //
71
72 /**
73 Generic Misc result set creation.
74
75 @param activation the activation for this result set
76
77 @return ResultSet A wrapper result set to run the Execution-time
78 logic.
79 @exception StandardException thrown when unable to create the
80 result set
81 */
82 ResultSet getMiscResultSet(Activation activation)
83 throws StandardException;
84
85 //
86 // Transaction operations
87 //
88 /**
89
90 @param activation the activation for this result set
91
92 @return ResultSet A wrapper result set to run the Execution-time
93 logic.
94 @exception StandardException thrown when unable to create the
95 result set
96 */
97 ResultSet getSetTransactionResultSet(Activation activation)
98 throws StandardException;
99
100 //
101 // DML statement operations
102 //
103 /**
104 An insert result set simply reports that it completed, and
105 the number of rows inserted. It does not return rows.
106 The insert has been completed once the
107 insert result set is available.
108
109 @param source the result set from which to take rows to
110 be inserted into the target table.
111 @param checkGM The code to enforce the check constraints, if any
112 @param activation the activation for this result set,
113 @return the insert operation as a result set.
114 @exception StandardException thrown when unable to perform the insert
115 */
116 ResultSet getInsertResultSet(NoPutResultSet source,
117 GeneratedMethod checkGM,
118 Activation activation)
119 throws StandardException;
120
121 /**
122 An insert VTI result set simply reports that it completed, and
123 the number of rows inserted. It does not return rows.
124 The insert has been completed once the
125 insert result set is available.
126
127 @param source the result set from which to take rows to
128 be inserted into the target table.
129 @param vtiRS The code to instantiate the VTI, if necessary
130 @param activation the activation for this result set,
131 @return the insert VTI operation as a result set.
132 @exception StandardException thrown when unable to perform the insert
133 */
134 ResultSet getInsertVTIResultSet(NoPutResultSet source,
135 NoPutResultSet vtiRS,
136 Activation activation)
137 throws StandardException;
138
139 /**
140 A delete VTI result set simply reports that it completed, and
141 the number of rows deleted. It does not return rows.
142 The delete has been completed once the
143 delete result set is available.
144
145 @param source the result set from which to take rows to
146 be inserted into the target table.
147 @param activation the activation for this result set,
148 @return the delete VTI operation as a result set.
149 @exception StandardException thrown when unable to perform the insert
150 */
151 ResultSet getDeleteVTIResultSet(NoPutResultSet source,
152 Activation activation)
153 throws StandardException;
154
155 /**
156 A delete result set simply reports that it completed, and
157 the number of rows deleted. It does not return rows.
158 The delete has been completed once the
159 delete result set is available.
160
161 @param source the result set from which to take rows to
162 be deleted from the target table. This result set must
163 contain one column which provides RowLocations that are
164 valid in the target table.
165 @param activation the activation for this result set
166 @return the delete operation as a result set.
167 @exception StandardException thrown when unable to perform the delete
168 */
169 ResultSet getDeleteResultSet(NoPutResultSet source,
170 Activation activation)
171 throws StandardException;
172
173 /**
174 A delete Cascade result set simply reports that it completed, and
175 the number of rows deleted. It does not return rows.
176 The delete has been completed once the
177 delete result set is available.
178
179 @param source the result set from which to take rows to
180 be deleted from the target table.
181 @param activation the activation for this result set
182 @param constantActionItem a constant action saved object reference
183 @param dependentResultSets an array of DeleteCascade Resultsets
184 for the current table referential action
185 dependents tables.
186 @param resultSetId an Id which is used to store the refence
187 to the temporary result set created of
188 the materilized rows.Dependent table resultsets
189 uses the same id to access their parent temporary result sets.
190 @return the delete operation as a delete cascade result set.
191 @exception StandardException thrown when unable to perform the delete
192 */
193 ResultSet getDeleteCascadeResultSet(NoPutResultSet source,
194 Activation activation, int constantActionItem,
195 ResultSet[] dependentResultSets,
196 String resultSetId)
197 throws StandardException;
198
199 /**
200 An update result set simply reports that it completed, and
201 the number of rows updated. It does not return rows.
202 The update has been completed once the
203 update result set is available.
204
205 @param source the result set from which to take rows to be
206 updated in the target table. This result set must contain
207 a column which provides RowLocations that are valid in the
208 target table, and new values to be placed in those rows.
209 @param checkGM The code to enforce the check constraints, if any
210 @param activation the activation for this result set
211 @return the update operation as a result set.
212 @exception StandardException thrown when unable to perform the update
213 */
214 ResultSet getUpdateResultSet(NoPutResultSet source,
215 GeneratedMethod checkGM,
216 Activation activation)
217 throws StandardException;
218
219 /**
220 * @param source the result set from which to take rows to be
221 * updated in the target table.
222 * @param vtiRS the updateable result set for the VTI
223 * @param activation the activation for this result set
224 * @return the update operation as a result set.
225 * @exception StandardException thrown on error
226 */
227 public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
228 Activation activation)
229 throws StandardException;
230
231 /**
232 An update result set simply reports that it completed, and
233 the number of rows updated. It does not return rows.
234 The update has been completed once the
235 update result set is available.
236
237 @param source the result set from which to take rows to be
238 updated in the target table. This result set must contain
239 a column which provides RowLocations that are valid in the
240 target table, and new values to be placed in those rows.
241 @param checkGM The code to enforce the check constraints, if any
242 @param activation the activation for this result set
243 @param constantActionItem a constant action saved object reference
244 @param rsdItem result Description, saved object id.
245 @return the update operation as a result set.
246 @exception StandardException thrown when unable to perform the update
247 */
248 ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source,
249 GeneratedMethod checkGM,
250 Activation activation,
251 int constantActionItem,
252 int rsdItem)
253 throws StandardException;
254
255 /**
256 A call statement result set simply reports that it completed.
257 It does not return rows.
258
259 @param methodCall a reference to a method in the activation
260 for the method call
261 @param activation the activation for this result set
262
263 @return the call statement operation as a result set.
264 @exception StandardException thrown when unable to perform the call statement
265 */
266 ResultSet getCallStatementResultSet(GeneratedMethod methodCall,
267 Activation activation)
268 throws StandardException;
269
270 //
271 // Query expression operations
272 //
273
274 /**
275 A project restrict result set iterates over its source,
276 evaluating a restriction and when it is satisfied,
277 constructing a row to return in its result set based on
278 its projection.
279 The rows can be constructed as they are requested from the
280 result set.
281
282 @param source the result set from which to take rows to be
283 filtered by this operation.
284 @param activation the activation for this result set,
285 against whcih the restriction and projection are performed
286 and to which current rows must be assigned for the
287 projection and restriction to be performed.
288 @param restriction a reference to a method in the activation
289 that is applied to the activation's "current row" field
290 to determine whether the restriction is satisfied or not.
291 The signature of this method is
292 <verbatim>
293 Boolean restriction() throws StandardException;
294 </verbatim>
295 @param projection a reference to a method in the activation
296 that is applied to the activation's "current row" field
297 to project out the expected result row.
298 The signature of this method is
299 <verbatim>
300 ExecRow projection() throws StandardException;
301 </verbatim>
302 @param resultSetNumber The resultSetNumber for the ResultSet
303 @param constantRestriction a reference to a method in the activation
304 that represents a constant expression (eg where 1 = 2).
305 The signature of this method is
306 <verbatim>
307 Boolean restriction() throws StandardException;
308 </verbatim>
309 @param mapArrayItem Item # for mapping of source to target columns
310 @param reuseResult Whether or not to reuse the result row.
311 @param doesProjection Whether or not this PRN does a projection
312 @param optimizerEstimatedRowCount Estimated total # of rows by
313 optimizer
314 @param optimizerEstimatedCost Estimated total cost by optimizer
315 @param closeCleanup any cleanup the activation needs to do on close.
316 @return the project restrict operation as a result set.
317 @exception StandardException thrown when unable to create the
318 result set
319 */
320 NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
321 Activation activation, GeneratedMethod restriction,
322 GeneratedMethod projection, int resultSetNumber,
323 GeneratedMethod constantRestriction,
324 int mapArrayItem,
325 boolean resuseResult,
326 boolean doesProjection,
327 double optimizerEstimatedRowCount,
328 double optimizerEstimatedCost,
329 GeneratedMethod closeCleanup) throws StandardException;
330
331 /**
332 A hash table result set builds a hash table on its source,
333 applying a list of predicates, if any, to the source,
334 when building the hash table. It then does a look up into
335 the hash table on a probe.
336 The rows can be constructed as they are requested from the
337 result set.
338
339 @param source the result set from which to take rows to be
340 filtered by this operation.
341 @param activation the activation for this result set,
342 against whcih the restriction and projection are performed
343 and to which current rows must be assigned for the
344 projection and restriction to be performed.
345 @param singleTableRestriction restriction, if any, applied to
346 input of hash table.
347 @param equijoinQualifiers Qualifier[] for look up into hash table
348 @param projection a reference to a method in the activation
349 that is applied to the activation's "current row" field
350 to project out the expected result row.
351 The signature of this method is
352 <verbatim>
353 ExecRow projection() throws StandardException;
354 </verbatim>
355 @param resultSetNumber The resultSetNumber for the ResultSet
356 @param mapArrayItem Item # for mapping of source to target columns
357 @param reuseResult Whether or not to reuse the result row.
358 @param keyColItem Item for hash key column array
359 @param removeDuplicates Whether or not to remove duplicates when building the hash table
360 @param maxInMemoryRowCount Max size of in-memory hash table
361 @param initialCapacity initialCapacity for java.util.HashTable
362 @param loadFactor loadFactor for java.util.HashTable
363 @param optimizerEstimatedRowCount Estimated total # of rows by
364 optimizer
365 @param optimizerEstimatedCost Estimated total cost by optimizer
366 @param closeCleanup any cleanup the activation needs to do on close.
367 @return the project restrict operation as a result set.
368 @exception StandardException thrown when unable to create the
369 result set
370 */
371 public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
372 Activation activation, GeneratedMethod singleTableRestriction,
373 Qualifier[][] equijoinQualifiers,
374 GeneratedMethod projection, int resultSetNumber,
375 int mapRefItem,
376 boolean reuseResult,
377 int keyColItem,
378 boolean removeDuplicates,
379 long maxInMemoryRowCount,
380 int initialCapacity,
381 float loadFactor,
382 double optimizerEstimatedRowCount,
383 double optimizerEstimatedCost,
384 GeneratedMethod closeCleanup)
385 throws StandardException;
386
387 /**
388 A sort result set sorts its source and if requested removes
389 duplicates. It will generate the entire result when open, and
390 then return it a row at a time.
391 <p>
392 If passed aggregates it will do scalar or vector aggregate
393 processing. A list of aggregator information is passed
394 off of the PreparedStatement's savedObjects. Aggregation
395 and SELECT DISTINCT cannot be processed in the same sort.
396
397 @param source the result set from which to take rows to be
398 filtered by this operation.
399 @param distinct true if distinct SELECT list
400 @param isInSortedOrder true if the source result set is in sorted order
401 @param orderItem entry in preparedStatement's savedObjects for order
402 @param activation the activation for this result set,
403 against which the sort-unique is performed.
404 @param rowAllocator a reference to a method in the activation
405 that generates rows of the right size and shape for the source
406 @param rowSize the size of the row that is allocated by rowAllocator.
407 size should be the maximum size of the sum of all the datatypes.
408 user type are necessarily approximated
409 @param resultSetNumber The resultSetNumber for the ResultSet
410 @param optimizerEstimatedRowCount Estimated total # of rows by
411 optimizer
412 @param optimizerEstimatedCost Estimated total cost by optimizer
413 @param closeCleanup any cleanup the activation needs to do on close.
414 @return the distinct operation as a result set.
415 @exception StandardException thrown when unable to create the
416 result set
417 */
418 NoPutResultSet getSortResultSet(NoPutResultSet source,
419 boolean distinct,
420 boolean isInSortedOrder,
421 int orderItem,
422 Activation activation,
423 GeneratedMethod rowAllocator,
424 int rowSize,
425 int resultSetNumber,
426 double optimizerEstimatedRowCount,
427 double optimizerEstimatedCost,
428 GeneratedMethod closeCleanup)
429 throws StandardException;
430
431 /**
432 A ScalarAggregateResultSet computes non-distinct scalar aggregates.
433 It will compute the aggregates when open.
434
435 @param source the result set from which to take rows to be
436 filtered by this operation.
437 @param isInSortedOrder true if the source result set is in sorted order
438 @param aggregateItem entry in preparedStatement's savedObjects for aggregates
439 @param orderingItem Ignored to allow same signature as getDistinctScalarAggregateResultSet
440 @param activation the activation for this result set,
441 against which the sort-unique is performed.
442 @param rowAllocator a reference to a method in the activation
443 that generates rows of the right size and shape for the source
444 @param rowSize Ignored to allow same signature as getDistinctScalarAggregateResultSet
445 @param resultSetNumber The resultSetNumber for the ResultSet
446 @param singleInputRow Whether we know we have a single input row or not
447 @param optimizerEstimatedRowCount Estimated total # of rows by
448 optimizer
449 @param optimizerEstimatedCost Estimated total cost by optimizer
450 @param closeCleanup any cleanup the activation needs to do on close.
451 @return the scalar aggregation operation as a result set.
452 @exception StandardException thrown when unable to create the
453 result set
454 */
455 NoPutResultSet getScalarAggregateResultSet(NoPutResultSet source,
456 boolean isInSortedOrder,
457 int aggregateItem,
458 int orderingItem,
459 Activation activation,
460 GeneratedMethod rowAllocator,
461 int rowSize,
462 int resultSetNumber,
463 boolean singleInputRow,
464 double optimizerEstimatedRowCount,
465 double optimizerEstimatedCost,
466 GeneratedMethod closeCleanup)
467 throws StandardException;
468
469 /**
470 A DistinctScalarAggregateResultSet computes scalar aggregates when
471 at least one of them is a distinct aggregate.
472 It will compute the aggregates when open.
473
474 @param source the result set from which to take rows to be
475 filtered by this operation.
476 @param isInSortedOrder true if the source result set is in sorted order
477 @param aggregateItem entry in preparedStatement's savedObjects for aggregates
478 @param orderItem entry in preparedStatement's savedObjects for order
479 @param activation the activation for this result set,
480 against which the sort-unique is performed.
481 @param rowAllocator a reference to a method in the activation
482 that generates rows of the right size and shape for the source
483 @param rowSize the size of the row that is allocated by rowAllocator.
484 size should be the maximum size of the sum of all the datatypes.
485 user type are necessarily approximated
486 @param resultSetNumber The resultSetNumber for the ResultSet
487 @param singleInputRow Whether we know we have a single input row or not
488 @param optimizerEstimatedRowCount Estimated total # of rows by
489 optimizer
490 @param optimizerEstimatedCost Estimated total cost by optimizer
491 @param closeCleanup any cleanup the activation needs to do on close.
492 @return the scalar aggregation operation as a result set.
493 @exception StandardException thrown when unable to create the
494 result set
495 */
496 NoPutResultSet getDistinctScalarAggregateResultSet(NoPutResultSet source,
497 boolean isInSortedOrder,
498 int aggregateItem,
499 int orderingItem,
500 Activation activation,
501 GeneratedMethod rowAllocator,
502 int rowSize,
503 int resultSetNumber,
504 boolean singleInputRow,
505 double optimizerEstimatedRowCount,
506 double optimizerEstimatedCost,
507 GeneratedMethod closeCleanup)
508 throws StandardException;
509
510 /**
511 A GroupedAggregateResultSet computes non-distinct grouped aggregates.
512 It will compute the aggregates when open.
513
514 @param source the result set from which to take rows to be
515 filtered by this operation.
516 @param isInSortedOrder true if the source result set is in sorted order
517 @param aggregateItem entry in preparedStatement's savedObjects for aggregates
518 @param orderingItem Ignored to allow same signature as getDistinctScalarAggregateResultSet
519 @param activation the activation for this result set,
520 against which the sort-unique is performed.
521 @param rowAllocator a reference to a method in the activation
522 that generates rows of the right size and shape for the source
523 @param rowSize Ignored to allow same signature as getDistinctScalarAggregateResultSet
524 @param resultSetNumber The resultSetNumber for the ResultSet
525 @param optimizerEstimatedRowCount Estimated total # of rows by
526 optimizer
527 @param optimizerEstimatedCost Estimated total cost by optimizer
528 @param closeCleanup any cleanup the activation needs to do on close.
529 @return the scalar aggregation operation as a result set.
530 @exception StandardException thrown when unable to create the
531 result set
532 */
533 NoPutResultSet getGroupedAggregateResultSet(NoPutResultSet source,
534 boolean isInSortedOrder,
535 int aggregateItem,
536 int orderingItem,
537 Activation activation,
538 GeneratedMethod rowAllocator,
539 int rowSize,
540 int resultSetNumber,
541 double optimizerEstimatedRowCount,
542 double optimizerEstimatedCost,
543 GeneratedMethod closeCleanup)
544 throws StandardException;
545
546 /**
547 A DistinctGroupedAggregateResultSet computes scalar aggregates when
548 at least one of them is a distinct aggregate.
549 It will compute the aggregates when open.
550
551 @param source the result set from which to take rows to be
552 filtered by this operation.
553 @param isInSortedOrder true if the source result set is in sorted order
554 @param aggregateItem entry in preparedStatement's savedObjects for aggregates
555 @param orderItem entry in preparedStatement's savedObjects for order
556 @param activation the activation for this result set,
557 against which the sort-unique is performed.
558 @param rowAllocator a reference to a method in the activation
559 that generates rows of the right size and shape for the source
560 @param rowSize the size of the row that is allocated by rowAllocator.
561 size should be the maximum size of the sum of all the datatypes.
562 user type are necessarily approximated
563 @param resultSetNumber The resultSetNumber for the ResultSet
564 @param optimizerEstimatedRowCount Estimated total # of rows by
565 optimizer
566 @param optimizerEstimatedCost Estimated total cost by optimizer
567 @param closeCleanup any cleanup the activation needs to do on close.
568 @return the scalar aggregation operation as a result set.
569 @exception StandardException thrown when unable to create the
570 result set
571 */
572 NoPutResultSet getDistinctGroupedAggregateResultSet(NoPutResultSet source,
573 boolean isInSortedOrder,
574 int aggregateItem,
575 int orderingItem,
576 Activation activation,
577 GeneratedMethod rowAllocator,
578 int rowSize,
579 int resultSetNumber,
580 double optimizerEstimatedRowCount,
581 double optimizerEstimatedCost,
582 GeneratedMethod closeCleanup)
583 throws StandardException;
584
585 /**
586 An any result set iterates over its source,
587 returning a row with all columns set to nulls
588 if the source returns no rows.
589
590 @param source the result set from which to take rows to be
591 filtered by this operation.
592 @param activation the activation for this result set,
593 against whcih the restriction and projection are performed
594 and to which current rows must be assigned for the
595 projection and restriction to be performed.
596 @param emptyRowFun a reference to a method in the activation
597 that is called if the source returns no rows
598 @param resultSetNumber The resultSetNumber for the ResultSet
599 @param subqueryNumber The subquery number for this subquery.
600 @param pointOfAttachment The point of attachment for this subquery.
601 @param optimizerEstimatedRowCount Estimated total # of rows by
602 optimizer
603 @param optimizerEstimatedCost Estimated total cost by optimizer
604 @return the any operation as a result set.
605 @exception StandardException thrown when unable to create the
606 result set
607 */
608 NoPutResultSet getAnyResultSet(NoPutResultSet source,
609 Activation activation, GeneratedMethod emptyRowFun, int resultSetNumber,
610 int subqueryNumber, int pointOfAttachment,
611 double optimizerEstimatedRowCount,
612 double optimizerEstimatedCost)
613 throws StandardException;
614
615 /**
616 A once result set iterates over its source,
617 raising an error if the source returns > 1 row and
618 returning a row with all columns set to nulls
619 if the source returns no rows.
620
621 @param source the result set from which to take rows to be
622 filtered by this operation.
623 @param activation the activation for this result set,
624 against whcih the restriction and projection are performed
625 and to which current rows must be assigned for the
626 projection and restriction to be performed.
627 @param emptyRowFun a reference to a method in the activation
628 that is called if the source returns no rows
629 @param cardinalityCheck The type of cardinality check, if any that
630 is required
631 @param resultSetNumber The resultSetNumber for the ResultSet
632 @param subqueryNumber The subquery number for this subquery.
633 @param pointOfAttachment The point of attachment for this subquery.
634 @param optimizerEstimatedRowCount Estimated total # of rows by
635 optimizer
636 @param optimizerEstimatedCost Estimated total cost by optimizer
637 @return the once operation as a result set.
638 @exception StandardException thrown when unable to create the
639 result set
640 */
641 NoPutResultSet getOnceResultSet(NoPutResultSet source,
642 Activation activation, GeneratedMethod emptyRowFun,
643 int cardinalityCheck, int resultSetNumber,
644 int subqueryNumber, int pointOfAttachment,
645 double optimizerEstimatedRowCount,
646 double optimizerEstimatedCost)
647 throws StandardException;
648
649 /**
650 A row result set forms a result set on a single, known row value.
651 It is used to turn constant rows into result sets for use in
652 the result set paradigm.
653 The row can be constructed when it is requested from the
654 result set.
655
656 @param activation the activation for this result set,
657 against which the row operation is performed to
658 create the result set.
659 @param row a reference to a method in the activation
660 that creates the expected row.
661 <verbatim>
662 ExecRow row() throws StandardException;
663 </verbatim>
664 @param canCacheRow True if execution can cache the input row
665 after it has gotten it. If the input row is constructed soley
666 of constants or parameters, it is ok to cache this row rather
667 than recreating it each time it is requested.
668 @param resultSetNumber The resultSetNumber for the ResultSet
669 @param optimizerEstimatedRowCount Estimated total # of rows by
670 optimizer
671 @param optimizerEstimatedCost Estimated total cost by optimizer
672 @param closeCleanup any cleanup the activation needs to do on close.
673 @return the row as a result set.
674 @exception StandardException thrown when unable to create the
675 result set
676 */
677 NoPutResultSet getRowResultSet(Activation activation, GeneratedMethod row,
678 boolean canCacheRow,
679 int resultSetNumber,
680 double optimizerEstimatedRowCount,
681 double optimizerEstimatedCost,
682 GeneratedMethod closeCleanup)
683 throws StandardException;
684
685 /**
686 A VTI result set wraps a user supplied result set.
687
688 @param activation the activation for this result set,
689 against which the row operation is performed to
690 create the result set.
691 @param row a reference to a method in the activation
692 that creates the expected row.
693 <verbatim>
694 ExecRow row() throws StandardException;
695 </verbatim>
696 @param resultSetNumber The resultSetNumber for the ResultSet
697 @param constructor The GeneratedMethod for the user's constructor
698 @param javaClassName The java class name for the VTI
699 @param erdNumber int for referenced column BitSet
700 (so it can be turned back into an object)
701 @param version2 Whether or not VTI is a version 2 VTI.
702 @param isTarget Whether or not VTI is a target VTI.
703 @param optimizerEstimatedRowCount Estimated total # of rows by
704 optimizer
705 @param optimizerEstimatedCost Estimated total cost by optimizer
706 @param closeCleanup any cleanup the activation needs to do on close.
707 @return the row as a result set.
708 @exception StandardException thrown when unable to create the
709 result set
710 */
711 public NoPutResultSet getVTIResultSet(Activation activation, GeneratedMethod row,
712 int resultSetNumber,
713 GeneratedMethod constructor,
714 String javaClassName,
715 Qualifier[][] pushedQualifiers,
716 int erdNumber,
717 boolean version2, boolean reuseablePs,
718 int ctcNumber,
719 boolean isTarget,
720 int scanIsolationLevel,
721 double optimizerEstimatedRowCount,
722 double optimizerEstimatedCost,
723 GeneratedMethod closeCleanup)
724 throws StandardException;
725
726 /**
727 A hash result set forms a result set on a hash table built on a scan
728 of a table.
729 The rows are put into the hash table on the 1st open.
730 <p>
731
732 @param conglomId the conglomerate of the table to be scanned.
733 @param scociItem The saved item for the static conglomerate info.
734 @param activation the activation for this result set,
735 which provides the context for the row allocation operation.
736 @param resultRowAllocator a reference to a method in the activation
737 that creates a holder for the rows from the scan.
738 <verbatim>
739 ExecRow rowAllocator() throws StandardException;
740 </verbatim>
741 @param resultSetNumber The resultSetNumber for the ResultSet
742 @param startKeyGetter a reference to a method in the activation
743 that gets the start key indexable row for the scan. Null
744 means there is no start key.
745 <verbatim>
746 ExecIndexRow startKeyGetter() throws StandardException;
747 </verbatim>
748 @param startSearchOperator The start search operator for opening
749 the scan
750 @param stopKeyGetter a reference to a method in the activation
751 that gets the stop key indexable row for the scan. Null means
752 there is no stop key.
753 <verbatim>
754 ExecIndexRow stopKeyGetter() throws StandardException;
755 </verbatim>
756 @param stopSearchOperator The stop search operator for opening
757 the scan
758 @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter
759 (Exact match search.)
760 @param scanQualifiers the array of Qualifiers for the scan.
761 Null or an array length of zero means there are no qualifiers.
762 @param nextQualifiers the array of Qualifiers for the look up into the hash table.
763 @param initialCapacity The initialCapacity for the HashTable.
764 @param loadFactor The loadFactor for the HashTable.
765 @param maxCapacity The maximum size for the HashTable.
766 @param hashKeyColumn The 0-based column # for the hash key.
767 @param tableName The full name of the table
768 @param indexName The name of the index, if one used to access table.
769 @param isConstraint If index, if used, is a backing index for a constraint.
770 @param forUpdate True means open for update
771 @param colRefItem An saved item for a bitSet of columns that
772 are referenced in the underlying table. -1 if
773 no item.
774 @param lockMode The lock granularity to use (see
775 TransactionController in access)
776 @param tableLocked Whether or not the table is marked as using table locking
777 (in sys.systables)
778 @param isolationLevel Isolation level (specified or not) to use on scans
779 @param optimizerEstimatedRowCount Estimated total # of rows by
780 optimizer
781 @param optimizerEstimatedCost Estimated total cost by optimizer
782 @param closeCleanup any cleanup the activation needs to do on close.
783 @return the table scan operation as a result set.
784 @exception StandardException thrown when unable to create the
785 result set
786 */
787 NoPutResultSet getHashScanResultSet(
788 long conglomId,
789 int scociItem,
790 Activation activation,
791 GeneratedMethod resultRowAllocator,
792 int resultSetNumber,
793 GeneratedMethod startKeyGetter,
794 int startSearchOperator,
795 GeneratedMethod stopKeyGetter,
796 int stopSearchOperator,
797 boolean sameStartStopPosition,
798 Qualifier[][] scanQualifiers,
799 Qualifier[][] nextQualifiers,
800 int initialCapacity,
801 float loadFactor,
802 int maxCapacity,
803 int hashKeyColumn,
804 String tableName,
805 String indexName,
806 boolean isConstraint,
807 boolean forUpdate,
808 int colRefItem,
809 int indexColItem,
810 int lockMode,
811 boolean tableLocked,
812 int isolationLevel,
813 double optimizerEstimatedRowCount,
814 double optimizerEstimatedCost,
815 GeneratedMethod closeCleanup)
816 throws StandardException;
817
818 /**
819 A distinct scan result set pushes duplicate elimination into
820 the scan.
821 <p>
822
823 @param conglomId the conglomerate of the table to be scanned.
824 @param scociItem The saved item for the static conglomerate info.
825 @param activation the activation for this result set,
826 which provides the context for the row allocation operation.
827 @param resultRowAllocator a reference to a method in the activation
828 that creates a holder for the rows from the scan.
829 <verbatim>
830 ExecRow rowAllocator() throws StandardException;
831 </verbatim>
832 @param resultSetNumber The resultSetNumber for the ResultSet
833 @param hashKeyColumn The 0-based column # for the hash key.
834 @param tableName The full name of the table
835 @param indexName The name of the index, if one used to access table.
836 @param isConstraint If index, if used, is a backing index for a constraint.
837 @param colRefItem An saved item for a bitSet of columns that
838 are referenced in the underlying table. -1 if
839 no item.
840 @param lockMode The lock granularity to use (see
841 TransactionController in access)
842 @param tableLocked Whether or not the table is marked as using table locking
843 (in sys.systables)
844 @param isolationLevel Isolation level (specified or not) to use on scans
845 @param optimizerEstimatedRowCount Estimated total # of rows by
846 optimizer
847 @param optimizerEstimatedCost Estimated total cost by optimizer
848 @param closeCleanup any cleanup the activation needs to do on close.
849 @return the table scan operation as a result set.
850 @exception StandardException thrown when unable to create the
851 result set
852 */
853 NoPutResultSet getDistinctScanResultSet(
854 long conglomId,
855 int scociItem,
856 Activation activation,
857 GeneratedMethod resultRowAllocator,
858 int resultSetNumber,
859 int hashKeyColumn,
860 String tableName,
861 String indexName,
862 boolean isConstraint,
863 int colRefItem,
864 int lockMode,
865 boolean tableLocked,
866 int isolationLevel,
867 double optimizerEstimatedRowCount,
868 double optimizerEstimatedCost,
869 GeneratedMethod closeCleanup)
870 throws StandardException;
871
872 /**
873 A table scan result set forms a result set on a scan
874 of a table.
875 The rows can be constructed as they are requested from the
876 result set.
877 <p>
878 This form of the table scan operation is simple, and is
879 to be used when there are no predicates to be passed down
880 to the scan to limit its scope on the target table.
881
882 @param conglomId the conglomerate of the table to be scanned.
883 @param scociItem The saved item for the static conglomerate info.
884 @param activation the activation for this result set,
885 which provides the context for the row allocation operation.
886 @param resultRowAllocator a reference to a method in the activation
887 that creates a holder for the result row of the scan. May
888 be a partial row.
889 <verbatim>
890 ExecRow rowAllocator() throws StandardException;
891 </verbatim>
892 @param resultSetNumber The resultSetNumber for the ResultSet
893 @param startKeyGetter a reference to a method in the activation
894 that gets the start key indexable row for the scan. Null
895 means there is no start key.
896 <verbatim>
897 ExecIndexRow startKeyGetter() throws StandardException;
898 </verbatim>
899 @param startSearchOperator The start search operator for opening
900 the scan
901 @param stopKeyGetter a reference to a method in the activation
902 that gets the stop key indexable row for the scan. Null means
903 there is no stop key.
904 <verbatim>
905 ExecIndexRow stopKeyGetter() throws StandardException;
906 </verbatim>
907 @param stopSearchOperator The stop search operator for opening
908 the scan
909 @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter
910 (Exact match search.)
911 @param qualifiers the array of Qualifiers for the scan.
912 Null or an array length of zero means there are no qualifiers.
913 @param tableName The full name of the table
914 @param indexName The name of the index, if one used to access table.
915 @param isConstraint If index, if used, is a backing index for a constraint.
916 @param forUpdate True means open for update
917 @param colRefItem An saved item for a bitSet of columns that
918 are referenced in the underlying table. -1 if
919 no item.
920 @param lockMode The lock granularity to use (see
921 TransactionController in access)
922 @param tableLocked Whether or not the table is marked as using table locking
923 (in sys.systables)
924 @param isolationLevel Isolation level (specified or not) to use on scans
925 @param oneRowScan Whether or not this is a 1 row scan.
926 @param optimizerEstimatedRowCount Estimated total # of rows by
927 optimizer
928 @param optimizerEstimatedCost Estimated total cost by optimizer
929 @param closeCleanup any cleanup the activation needs to do on close.
930
931 @return the table scan operation as a result set.
932 @exception StandardException thrown when unable to create the
933 result set
934 */
935 NoPutResultSet getTableScanResultSet(
936 long conglomId,
937 int scociItem,
938 Activation activation,
939 GeneratedMethod resultRowAllocator,
940 int resultSetNumber,
941 GeneratedMethod startKeyGetter,
942 int startSearchOperator,
943 GeneratedMethod stopKeyGetter,
944 int stopSearchOperator,
945 boolean sameStartStopPosition,
946 Qualifier[][] qualifiers,
947 String tableName,
948 String indexName,
949 boolean isConstraint,
950 boolean forUpdate,
951 int colRefItem,
952 int indexColItem,
953 int lockMode,
954 boolean tableLocked,
955 int isolationLevel,
956 boolean oneRowScan,
957 double optimizerEstimatedRowCount,
958 double optimizerEstimatedCost,
959 GeneratedMethod closeCleanup)
960 throws StandardException;
961
962 /**
963 A table scan result set forms a result set on a scan
964 of a table.
965 The rows can be constructed as they are requested from the
966 result set.
967 <p>
968 This form of the table scan operation is simple, and is
969 to be used when there are no predicates to be passed down
970 to the scan to limit its scope on the target table.
971
972 @param conglomId the conglomerate of the table to be scanned.
973 @param scociItem The saved item for the static conglomerate info.
974 @param activation the activation for this result set,
975 which provides the context for the row allocation operation.
976 @param resultRowAllocator a reference to a method in the activation
977 that creates a holder for the result row of the scan. May
978 be a partial row.
979 <verbatim>
980 ExecRow rowAllocator() throws StandardException;
981 </verbatim>
982 @param resultSetNumber The resultSetNumber for the ResultSet
983 @param startKeyGetter a reference to a method in the activation
984 that gets the start key indexable row for the scan. Null
985 means there is no start key.
986 <verbatim>
987 ExecIndexRow startKeyGetter() throws StandardException;
988 </verbatim>
989 @param startSearchOperator The start search operator for opening
990 the scan
991 @param stopKeyGetter a reference to a method in the activation
992 that gets the stop key indexable row for the scan. Null means
993 there is no stop key.
994 <verbatim>
995 ExecIndexRow stopKeyGetter() throws StandardException;
996 </verbatim>
997 @param stopSearchOperator The stop search operator for opening
998 the scan
999 @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter
1000 (Exact match search.)
1001 @param qualifiers the array of Qualifiers for the scan.
1002 Null or an array length of zero means there are no qualifiers.
1003 @param tableName The full name of the table
1004 @param indexName The name of the index, if one used to access table.
1005 @param isConstraint If index, if used, is a backing index for a constraint.
1006 @param forUpdate True means open for update
1007 @param colRefItem An saved item for a bitSet of columns that
1008 are referenced in the underlying table. -1 if
1009 no item.
1010 @param lockMode The lock granularity to use (see
1011 TransactionController in access)
1012 @param tableLocked Whether or not the table is marked as using table locking
1013 (in sys.systables)
1014 @param isolationLevel Isolation level (specified or not) to use on scans
1015 @param rowsPerRead The number of rows to read per fetch.
1016 @param oneRowScan Whether or not this is a 1 row scan.
1017 @param optimizerEstimatedRowCount Estimated total # of rows by
1018 optimizer
1019 @param optimizerEstimatedCost Estimated total cost by optimizer
1020 @param closeCleanup any cleanup the activation needs to do on close.
1021
1022 @return the table scan operation as a result set.
1023 @exception StandardException thrown when unable to create the
1024 result set
1025 */
1026 NoPutResultSet getBulkTableScanResultSet(
1027 long conglomId,
1028 int scociItem,
1029 Activation activation,
1030 GeneratedMethod resultRowAllocator,
1031 int resultSetNumber,
1032 GeneratedMethod startKeyGetter,
1033 int startSearchOperator,
1034 GeneratedMethod stopKeyGetter,
1035 int stopSearchOperator,
1036 boolean sameStartStopPosition,
1037 Qualifier[][] qualifiers,
1038 String tableName,
1039 String indexName,
1040 boolean isConstraint,
1041 boolean forUpdate,
1042 int colRefItem,
1043 int indexColItem,
1044 int lockMode,
1045 boolean tableLocked,
1046 int isolationLevel,
1047 int rowsPerRead,
1048 boolean oneRowScan,
1049 double optimizerEstimatedRowCount,
1050 double optimizerEstimatedCost,
1051 GeneratedMethod closeCleanup)
1052 throws StandardException;
1053 /**
1054 An index row to base row result set gets an index row from its source
1055 and uses the RowLocation in its last column to get the row from the
1056 base conglomerate.
1057 <p>
1058
1059 @param conglomId Conglomerate # for the heap.
1060 @param scociItem The saved item for the static conglomerate info.
1061 @param activation the activation for this result set,
1062 which provides the context for the row allocation operation.
1063 @param source the source result set, which is expected to provide
1064 rows from an index conglomerate
1065 @param resultRowAllocator a reference to a method in the activation
1066 that creates a holder for the rows from the scan.
1067 <verbatim>
1068 ExecRow rowAllocator() throws StandardException;
1069 </verbatim>
1070 @param resultSetNumber The resultSetNumber for the ResultSet
1071 @param indexName The name of the index.
1072 @param heapColRefItem A saved item for a bitImpl of columns that
1073 are referenced in the underlying heap. -1 if
1074 no item.
1075 @param indexColRefItem A saved item for a bitImpl of columns that
1076 are referenced in the underlying index. -1 if
1077 no item.
1078 @param indexColMapItem A saved item for a ReferencedColumnsDescriptorImpl
1079 which tell which columms are coming from the index.
1080 @param restriction The restriction, if any, to be applied to the base row
1081 @param forUpdate True means to open for update
1082 @param optimizerEstimatedRowCount Estimated total # of rows by
1083 optimizer
1084 @param optimizerEstimatedCost Estimated total cost by optimizer
1085 @param closeCleanup any cleanup the activation needs to do on close.
1086
1087 @return the index row to base row operation as a result set.
1088 @exception StandardException thrown when unable to create the
1089 result set
1090 */
1091 public NoPutResultSet getIndexRowToBaseRowResultSet(
1092 long conglomId,
1093 int scoci,
1094 Activation a,
1095 NoPutResultSet source,
1096 GeneratedMethod resultRowAllocator,
1097 int resultSetNumber,
1098 String indexName,
1099 int heapColRefItem,
1100 int indexColRefItem,
1101 int indexColMapItem,
1102 GeneratedMethod restriction,
1103 boolean forUpdate,
1104 double optimizerEstimatedRowCount,
1105 double optimizerEstimatedCost,
1106 GeneratedMethod closeCleanup)
1107 throws StandardException;
1108
1109 /**
1110 A nested loop left outer join result set forms a result set on top of
1111 2 other result sets.
1112 The rows can be constructed as they are requested from the
1113 result set.
1114 <p>
1115 This form of the nested loop join operation is simple, and is
1116 to be used when there are no join predicates to be passed down
1117 to the join to limit its scope on the right ResultSet.
1118
1119 @param leftResultSet Outer ResultSet for join.
1120 @param leftNumCols Number of columns in the leftResultSet
1121 @param rightResultSet Inner ResultSet for join.
1122 @param rightNumCols Number of columns in the rightResultSet
1123 @param activation the activation for this result set,
1124 which provides the context for the row allocation operation.
1125 @param joinClause a reference to a method in the activation
1126 that is applied to the activation's "current row" field
1127 to determine whether the joinClause is satisfied or not.
1128 The signature of this method is
1129 <verbatim>
1130 Boolean joinClause() throws StandardException;
1131 </verbatim>
1132 @param resultSetNumber The resultSetNumber for the ResultSet
1133 @param oneRowRightSide boolean, whether or not the right side returns
1134 a single row. (No need to do 2nd next() if it does.)
1135 @param notExistsRightSide boolean, whether or not the right side resides a
1136 NOT EXISTS base table
1137 @param optimizerEstimatedRowCount Estimated total # of rows by
1138 optimizer
1139 @param optimizerEstimatedCost Estimated total cost by optimizer
1140 @param closeCleanup any cleanup the activation needs to do on close.
1141 @return the nested loop join operation as a result set.
1142 @exception StandardException thrown when unable to create the
1143 result set
1144 */
1145 public NoPutResultSet getNestedLoopJoinResultSet(NoPutResultSet leftResultSet,
1146 int leftNumCols,
1147 NoPutResultSet rightResultSet,
1148 int rightNumCols,
1149 Activation activation,
1150 GeneratedMethod joinClause,
1151 int resultSetNumber,
1152 boolean oneRowRightSide,
1153 boolean notExistsRightSide,
1154 double optimizerEstimatedRowCount,
1155 double optimizerEstimatedCost,
1156 GeneratedMethod closeCleanup)
1157 throws StandardException;
1158
1159 /**
1160 A hash join.
1161
1162 @param leftResultSet Outer ResultSet for join.
1163 @param leftNumCols Number of columns in the leftResultSet
1164 @param rightResultSet Inner ResultSet for join.
1165 @param rightNumCols Number of columns in the rightResultSet
1166 @param activation the activation for this result set,
1167 which provides the context for the row allocation operation.
1168 @param joinClause a reference to a method in the activation
1169 that is applied to the activation's "current row" field
1170 to determine whether the joinClause is satisfied or not.
1171 The signature of this method is
1172 <verbatim>
1173 Boolean joinClause() throws StandardException;
1174 </verbatim>
1175 @param resultSetNumber The resultSetNumber for the ResultSet
1176 @param oneRowRightSide boolean, whether or not the right side returns
1177 a single row. (No need to do 2nd next() if it does.)
1178 @param notExistsRightSide boolean, whether or not the right side resides a
1179 NOT EXISTS base table
1180 @param optimizerEstimatedRowCount Estimated total # of rows by
1181 optimizer
1182 @param optimizerEstimatedCost Estimated total cost by optimizer
1183 @param closeCleanup any cleanup the activation needs to do on close.
1184 @return the nested loop join operation as a result set.
1185 @exception StandardException thrown when unable to create the
1186 result set
1187 */
1188 public NoPutResultSet getHashJoinResultSet(NoPutResultSet leftResultSet,
1189 int leftNumCols,
1190 NoPutResultSet rightResultSet,
1191 int rightNumCols,
1192 Activation activation,
1193 GeneratedMethod joinClause,
1194 int resultSetNumber,
1195 boolean oneRowRightSide,
1196 boolean notExistsRightSide,
1197 double optimizerEstimatedRowCount,
1198 double optimizerEstimatedCost,
1199 GeneratedMethod closeCleanup)
1200 throws StandardException;
1201
1202
1203 /**
1204 A nested loop join result set forms a result set on top of
1205 2 other result sets.
1206 The rows can be constructed as they are requested from the
1207 result set.
1208 <p>
1209 This form of the nested loop join operation is simple, and is
1210 to be used when there are no join predicates to be passed down
1211 to the join to limit its scope on the right ResultSet.
1212
1213 @param leftResultSet Outer ResultSet for join.
1214 @param leftNumCols Number of columns in the leftResultSet
1215 @param rightResultSet Inner ResultSet for join.
1216 @param rightNumCols Number of columns in the rightResultSet
1217 @param activation the activation for this result set,
1218 which provides the context for the row allocation operation.
1219 @param joinClause a reference to a method in the activation
1220 that is applied to the activation's "current row" field
1221 to determine whether the joinClause is satisfied or not.
1222 The signature of this method is
1223 <verbatim>
1224 Boolean joinClause() throws StandardException;
1225 </verbatim>
1226 @param resultSetNumber The resultSetNumber for the ResultSet
1227 @param emptyRowFun a reference to a method in the activation
1228 that is called if the right child returns no rows
1229 @param wasRightOuterJoin Whether or not this was originally a right outer join
1230 @param oneRowRightSide boolean, whether or not the right side returns
1231 a single row. (No need to do 2nd next() if it does.)
1232 @param notExistsRightSide boolean, whether or not the right side resides a
1233 NOT EXISTS base table
1234 @param optimizerEstimatedRowCount Estimated total # of rows by
1235 optimizer
1236 @param optimizerEstimatedCost Estimated total cost by optimizer
1237 @param closeCleanup any cleanup the activation needs to do on close.
1238 @return the nested loop join operation as a result set.
1239 @exception StandardException thrown when unable to create the
1240 result set
1241 */
1242 public NoPutResultSet getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftResultSet,
1243 int leftNumCols,
1244 NoPutResultSet rightResultSet,
1245 int rightNumCols,
1246 Activation activation,
1247 GeneratedMethod joinClause,
1248 int resultSetNumber,
1249 GeneratedMethod emptyRowFun,
1250 boolean wasRightOuterJoin,
1251 boolean oneRowRightSide,
1252 boolean notExistsRightSide,
1253 double optimizerEstimatedRowCount,
1254 double optimizerEstimatedCost,
1255 GeneratedMethod closeCleanup)
1256 throws StandardException;
1257
1258 /**
1259 A left outer join using a hash join.
1260
1261 @param leftResultSet Outer ResultSet for join.
1262 @param leftNumCols Number of columns in the leftResultSet
1263 @param rightResultSet Inner ResultSet for join.
1264 @param rightNumCols Number of columns in the rightResultSet
1265 @param activation the activation for this result set,
1266 which provides the context for the row allocation operation.
1267 @param joinClause a reference to a method in the activation
1268 that is applied to the activation's "current row" field
1269 to determine whether the joinClause is satisfied or not.
1270 The signature of this method is
1271 <verbatim>
1272 Boolean joinClause() throws StandardException;
1273 </verbatim>
1274 @param resultSetNumber The resultSetNumber for the ResultSet
1275 @param emptyRowFun a reference to a method in the activation
1276 that is called if the right child returns no rows
1277 @param wasRightOuterJoin Whether or not this was originally a right outer join
1278 @param oneRowRightSide boolean, whether or not the right side returns
1279 a single row. (No need to do 2nd next() if it does.)
1280 @param notExistsRightSide boolean, whether or not the right side resides a
1281 NOT EXISTS base table
1282 @param optimizerEstimatedRowCount Estimated total # of rows by
1283 optimizer
1284 @param optimizerEstimatedCost Estimated total cost by optimizer
1285 @param closeCleanup any cleanup the activation needs to do on close.
1286 @return the nested loop join operation as a result set.
1287 @exception StandardException thrown when unable to create the
1288 result set
1289 */
1290 public NoPutResultSet getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet,
1291 int leftNumCols,
1292 NoPutResultSet rightResultSet,
1293 int rightNumCols,
1294 Activation activation,
1295 GeneratedMethod joinClause,
1296 int resultSetNumber,
1297 GeneratedMethod emptyRowFun,
1298 boolean wasRightOuterJoin,
1299 boolean oneRowRightSide,
1300 boolean notExistsRightSide,
1301 double optimizerEstimatedRowCount,
1302 double optimizerEstimatedCost,
1303 GeneratedMethod closeCleanup)
1304 throws StandardException;
1305
1306 /**
1307 A ResultSet which materializes the underlying ResultSet tree into a
1308 temp table on the 1st open. All subsequent "scans" of this ResultSet
1309 will return results from the temp table.
1310
1311 @param source the result set input to this result set.
1312 @param activation the activation for this result set,
1313 which provides the context for normalization.
1314 @param resultSetNumber The resultSetNumber for the ResultSet
1315 @param optimizerEstimatedRowCount Estimated total # of rows by
1316 optimizer
1317 @param optimizerEstimatedCost Estimated total cost by optimizer
1318 @param closeCleanup any cleanup the activation needs to do on close.
1319 @return the materialization operation as a result set.
1320
1321 @exception StandardException Thrown on failure
1322 */
1323 NoPutResultSet getMaterializedResultSet(NoPutResultSet source, Activation activation,
1324 int resultSetNumber,
1325 double optimizerEstimatedRowCount,
1326 double optimizerEstimatedCost,
1327 GeneratedMethod closeCleanup)
1328 throws StandardException;
1329
1330 /**
1331 A ResultSet which provides the insensitive scrolling functionality
1332 for the underlying result set by materializing the underlying ResultSet
1333 tree into a hash table while scrolling forward.
1334
1335 @param source the result set input to this result set.
1336 @param activation the activation for this result set,
1337 which provides the context for normalization.
1338 @param resultSetNumber The resultSetNumber for the ResultSet
1339 @param sourceRowWidth The # of columns in the source row.
1340 @param optimizerEstimatedRowCount Estimated total # of rows by
1341 optimizer
1342 @param optimizerEstimatedCost Estimated total cost by optimizer
1343 @param closeCleanup any cleanup the activation needs to do on close.
1344 @return the materialization operation as a result set.
1345
1346 @exception StandardException Thrown on failure
1347 */
1348 NoPutResultSet getScrollInsensitiveResultSet(NoPutResultSet source, Activation activation,
1349 int resultSetNumber,
1350 int sourceRowWidth,
1351 boolean scrollable,
1352 double optimizerEstimatedRowCount,
1353 double optimizerEstimatedCost,
1354 GeneratedMethod closeCleanup)
1355 throws StandardException;
1356
1357 /**
1358 REMIND: needs more description...
1359
1360 @param source the result set input to this result set.
1361 @param activation the activation for this result set,
1362 which provides the context for normalization.
1363 @param resultSetNumber The resultSetNumber for the ResultSet
1364 @param erdNumber int for ResultDescription
1365 (so it can be turned back into an object)
1366 @param optimizerEstimatedRowCount Estimated total # of rows by
1367 optimizer
1368 @param optimizerEstimatedCost Estimated total cost by optimizer
1369 @param closeCleanup any cleanup the activation needs to do on close.
1370 @return the normalization operation as a result set.
1371
1372 @exception StandardException Thrown on failure
1373 */
1374 NoPutResultSet getNormalizeResultSet(NoPutResultSet source,
1375 Activation activation,
1376 int resultSetNumber, int erdNumber,
1377 double optimizerEstimatedRowCount,
1378 double optimizerEstimatedCost,
1379 boolean forUpdate,
1380 GeneratedMethod closeCleanup)
1381 throws StandardException;
1382
1383 /**
1384 A current of result set forms a result set on the
1385 current row of an open cursor.
1386 It is used to perform positioned operations such as
1387 positioned update and delete, using the result set paradigm.
1388
1389 @param cursorName the name of the cursor providing the row.
1390 @param activation the activation for this result set,
1391 used to provide information about the result set.
1392 @param resultSetNumber The resultSetNumber for the ResultSet
1393 */
1394 NoPutResultSet getCurrentOfResultSet(String cursorName, Activation activation,
1395 int resultSetNumber, String psName);
1396
1397 /**
1398 * The Union interface is used to evaluate the union (all) of two ResultSets.
1399 * (Any duplicate elimination is performed above this ResultSet.)
1400 *
1401 * Forms a ResultSet returning the union of the rows in two source
1402 * ResultSets. The column types in source1 and source2 are assumed to be
1403 * the same.
1404 *
1405 * @param source1 The first ResultSet whose rows go into the union
1406 * @param source2 The second ResultSet whose rows go into the
1407 * union
1408 * @param activation the activation for this result set,
1409 * which provides the context for normalization.
1410 * @param resultSetNumber The resultSetNumber for the ResultSet
1411 * @param closeCleanup any cleanup the activation needs to do on close.
1412 * @param optimizerEstimatedRowCount Estimated total # of rows by
1413 * optimizer
1414 * @param optimizerEstimatedCost Estimated total cost by optimizer
1415 *
1416 * @return A ResultSet from which the caller can get the union
1417 * of the two source ResultSets.
1418 *
1419 * @exception StandardException Thrown on failure
1420 */
1421 NoPutResultSet getUnionResultSet(NoPutResultSet source1,
1422 NoPutResultSet source2,
1423 Activation activation,
1424 int resultSetNumber,
1425 double optimizerEstimatedRowCount,
1426 double optimizerEstimatedCost,
1427 GeneratedMethod closeCleanup)
1428 throws StandardException;
1429
1430
1431 /**
1432 * The SetOpResultSet is used to implement an INTERSECT or EXCEPT operation.
1433 * It selects rows from two ordered input result sets.
1434 *
1435 * @param leftSource The result set that implements the left input
1436 * @param rightSource The result set that implements the right input
1437 * @param activation the activation for this result set
1438 * @param resultSetNumber
1439 * @param optimizerEstimatedRowCount
1440 * @param optimizerEstimatedCost
1441 * @param opType IntersectOrExceptNode.INTERSECT_OP or EXCEPT_OP
1442 * @param all true if the operation is an INTERSECT ALL or an EXCEPT ALL,
1443 * false if the operation is an INTERSECT DISCTINCT or an EXCEPT DISCTINCT
1444 * @param closeCleanup a method to be called by close
1445 * @param intermediateOrderByColumnsSavedObject The saved object index for the array of order by columns for the
1446 * ordering of the left and right sources. That is, both the left and right sources have an order by
1447 * clause of the form ORDER BY intermediateOrderByColumns[0],intermediateOrderByColumns[1],...
1448 * @param intermediateOrderByDirectionSavedObject The saved object index for the array of source
1449 * order by directions. That is, the ordering of the i'th order by column in the input is ascending
1450 * if intermediateOrderByDirection[i] is 1, descending if intermediateOrderByDirection[i] is -1.
1451 *
1452 * @return A ResultSet from which the caller can get the INTERSECT or EXCEPT
1453 *
1454 * @exception StandardException Thrown on failure
1455 */
1456 NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,
1457 NoPutResultSet rightSource,
1458 Activation activation,
1459 int resultSetNumber,
1460 long optimizerEstimatedRowCount,
1461 double optimizerEstimatedCost,
1462 int opType,
1463 boolean all,
1464 GeneratedMethod closeCleanup,
1465 int intermediateOrderByColumnsSavedObject,
1466 int intermediateOrderByDirectionSavedObject)
1467 throws StandardException;
1468
1469
1470 //
1471 // Misc operations
1472 //
1473
1474
1475
1476 /**
1477 * A last index key result set returns the last row from
1478 * the index in question. It is used as an ajunct to max().
1479 *
1480 * @param activation the activation for this result set,
1481 * which provides the context for the row allocation operation.
1482 * @param resultSetNumber The resultSetNumber for the ResultSet
1483 * @param resultRowAllocator a reference to a method in the activation
1484 * that creates a holder for the result row of the scan. May
1485 * be a partial row. <verbatim>
1486 * ExecRow rowAllocator() throws StandardException; </verbatim>
1487 * @param conglomId the conglomerate of the table to be scanned.
1488 * @param tableName The full name of the table
1489 * @param indexName The name of the index, if one used to access table.
1490 * @param colRefItem An saved item for a bitSet of columns that
1491 * are referenced in the underlying table. -1 if
1492 * no item.
1493 * @param lockMode The lock granularity to use (see
1494 * TransactionController in access)
1495 * @param tableLocked Whether or not the table is marked as using table locking
1496 * (in sys.systables)
1497 * @param isolationLevel Isolation level (specified or not) to use on scans
1498 * @param optimizerEstimatedRowCount Estimated total # of rows by
1499 * optimizer
1500 * @param optimizerEstimatedCost Estimated total cost by optimizer
1501 * @param closeCleanup any cleanup the activation needs to do on close.
1502 *
1503 * @return the scan operation as a result set.
1504 *
1505 * @exception StandardException thrown when unable to create the
1506 * result set
1507 */
1508