Top Description Constructors Methods
org.apache.derby.impl.sql.execute

public Class GenericResultSetFactory

extends Object
implements ResultSetFactory
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.ResultSetFactory
Imports
org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, .ResultSet, org.apache.derby.iapi.sql.conn.Authorizer, .LanguageConnectionContext, org.apache.derby.iapi.sql.execute.NoPutResultSet, .ResultSetFactory, org.apache.derby.iapi.store.access.Qualifier, .StaticCompiledOpenConglomInfo, org.apache.derby.iapi.types.DataValueDescriptor

ResultSetFactory provides a wrapper around all of the result sets used in this execution implementation. This removes the need of generated classes to do a new and of the generator to know about all of the result sets. Both simply know about this interface to getting them.

In terms of modularizing, we can create just an interface to this class and invoke the interface. Different implementations would get the same information provided but could potentially massage/ignore it in different ways to satisfy their implementations. The practicality of this is to be seen.

The cost of this type of factory is that once you touch it, you touch *all* of the possible result sets, not just the ones you need. So the first time you touch it could be painful ... that might be a problem for execution.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public NoPutResultSet
getAnyResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
GeneratedMethod
a reference to a method in the activation that is called if the source returns no rows
emptyRowFun
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The subquery number for this subquery.
subqueryNumber
,
int
The point of attachment for this subquery.
pointOfAttachment
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getAnyResultSet.

An any result set iterates over its source, returning a row with all columns set to nulls if the source returns no rows.

private static Authorizer
public NoPutResultSet
getBulkTableScanResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
long
the conglomerate of the table to be scanned.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
int
The saved item for result row template.
resultRowTemplate
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. "ExecIndexRow startKeyGetter() throws StandardException;"
startKeyGetter
,
int
The start search operator for opening the scan
startSearchOperator
,
GeneratedMethod
a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. "ExecIndexRow stopKeyGetter() throws StandardException;"
stopKeyGetter
,
int
The stop search operator for opening the scan
stopSearchOperator
,
boolean
Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
sameStartStopPosition
,
Qualifier[][]
the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
qualifiers
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
boolean
If index, if used, is a backing index for a constraint.
isConstraint
,
boolean
True means open for update
forUpdate
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int indexColItem, int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
int
The number of rows to read per fetch.
rowsPerRead
,
boolean
Whether or not bulk fetch should be disabled at runtime if the cursor is holdable.
disableForHoldable
,
boolean
Whether or not this is a 1 row scan.
oneRowScan
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getBulkTableScanResultSet.

Table/Index scan where rows are read in bulk

public ResultSet
getCallStatementResultSet(GeneratedMethod
a reference to a method in the activation for the method call
methodCall
,
Activation
the activation for this result set
activation
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getCallStatementResultSet.

A call statement result set simply reports that it completed.

public NoPutResultSet
getCurrentOfResultSet(String
the name of the cursor providing the row.
cursorName
,
Activation activation, int
The resultSetNumber for the ResultSet
resultSetNumber
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getCurrentOfResultSet.

A current of result set forms a result set on the current row of an open cursor.

public ResultSet
getDDLResultSet(Activation
the activation for this result set
activation
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDDLResultSet.

Generic DDL result set creation.

public ResultSet
getDeleteCascadeResultSet(NoPutResultSet
the result set from which to take rows to be deleted from the target table.
source
,
int
a constant action saved object reference
constantActionItem
,
ResultSet[]
an array of DeleteCascade Resultsets for the current table referential action dependents tables.
dependentResultSets
,
String
an Id which is used to store the refence to the temporary result set created of the materilized rows.Dependent table resultsets uses the same id to access their parent temporary result sets.
resultSetId
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDeleteCascadeResultSet.

A delete Cascade result set simply reports that it completed, and the number of rows deleted.

public ResultSet
getDeleteCascadeUpdateResultSet(NoPutResultSet
the result set from which to take rows to be updated in the target table. This result set must contain a column which provides RowLocations that are valid in the target table, and new values to be placed in those rows.
source
,
GeneratedMethod
The code to compute generated columns, if any
generationClauses
,
GeneratedMethod
The code to enforce the check constraints, if any
checkGM
,
int
a constant action saved object reference
constantActionItem
,
int
result Description, saved object id.
rsdItem
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDeleteCascadeUpdateResultSet.

An update result set simply reports that it completed, and the number of rows updated.

public ResultSet
getDeleteResultSet(NoPutResultSet
the result set from which to take rows to be deleted from the target table. This result set must contain one column which provides RowLocations that are valid in the target table.
source
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDeleteResultSet.

A delete result set simply reports that it completed, and the number of rows deleted.

public ResultSet
getDeleteVTIResultSet(NoPutResultSet
the result set from which to take rows to be inserted into the target table.
source
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDeleteVTIResultSet.

A delete VTI result set simply reports that it completed, and the number of rows deleted.

public NoPutResultSet
getDistinctGroupedAggregateResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
boolean
true if the source result set is in sorted order
isInSortedOrder
,
int
entry in preparedStatement's savedObjects for aggregates
aggregateItem
,
int
entry in preparedStatement's savedObjects for order
orderItem
,
int
a reference to a saved object that generates rows of the right size and shape for the source
rowAllocator
,
int
the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
maxRowSize
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
boolean
true if this is a GROUP BY ROLLUP()
isRollup
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDistinctGroupedAggregateResultSet.

A DistinctGroupedAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.

public NoPutResultSet
getDistinctScalarAggregateResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
boolean
true if the source result set is in sorted order
isInSortedOrder
,
int
entry in preparedStatement's savedObjects for aggregates
aggregateItem
,
int
entry in preparedStatement's savedObjects for order
orderItem
,
int
a reference to a saved object that generates rows of the right size and shape for the source
rowAllocator
,
int
the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
maxRowSize
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
boolean
Whether we know we have a single input row or not
singleInputRow
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDistinctScalarAggregateResultSet.

A DistinctScalarAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.

public NoPutResultSet
getDistinctScanResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
long
the conglomerate of the table to be scanned.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
int
The saved item for result row template.
resultRowTemplate
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The 0-based column # for the hash key.
hashKeyColumn
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
boolean
If index, if used, is a backing index for a constraint.
isConstraint
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getDistinctScanResultSet.

a distinct scan generator, for ease of use at present.

public NoPutResultSet
getGroupedAggregateResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
boolean
true if the source result set is in sorted order
isInSortedOrder
,
int
entry in preparedStatement's savedObjects for aggregates
aggregateItem
,
int
Ignored to allow same signature as getDistinctScalarAggregateResultSet
orderItem
,
int
a reference to a saved object that generates rows of the right size and shape for the source
rowAllocator
,
int
Ignored to allow same signature as getDistinctScalarAggregateResultSet
maxRowSize
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
boolean
true if this is a GROUP BY ROLLUP()
isRollup
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getGroupedAggregateResultSet.

A GroupedAggregateResultSet computes non-distinct grouped aggregates.

public NoPutResultSet
getHashJoinResultSet(NoPutResultSet
Outer ResultSet for join.
leftResultSet
,
int
Number of columns in the leftResultSet
leftNumCols
,
NoPutResultSet
Inner ResultSet for join.
rightResultSet
,
int
Number of columns in the rightResultSet
rightNumCols
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is "Boolean joinClause() throws StandardException;"
joinClause
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
boolean
boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
oneRowRightSide
,
boolean
boolean, whether or not the right side resides a NOT EXISTS base table
notExistsRightSide
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getHashJoinResultSet.

A hash join.

public NoPutResultSet
getHashLeftOuterJoinResultSet(NoPutResultSet
Outer ResultSet for join.
leftResultSet
,
int
Number of columns in the leftResultSet
leftNumCols
,
NoPutResultSet
Inner ResultSet for join.
rightResultSet
,
int
Number of columns in the rightResultSet
rightNumCols
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is "Boolean joinClause() throws StandardException;"
joinClause
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that is called if the right child returns no rows
emptyRowFun
,
boolean
Whether or not this was originally a right outer join
wasRightOuterJoin
,
boolean
boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
oneRowRightSide
,
boolean
boolean, whether or not the right side resides a NOT EXISTS base table
notExistsRightSide
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getHashLeftOuterJoinResultSet.

A left outer join using a hash join.

public NoPutResultSet
getHashScanResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
long
the conglomerate of the table to be scanned.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
int
The saved item for result row template.
resultRowTemplate
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. "ExecIndexRow startKeyGetter() throws StandardException;"
startKeyGetter
,
int
The start search operator for opening the scan
startSearchOperator
,
GeneratedMethod
a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. "ExecIndexRow stopKeyGetter() throws StandardException;"
stopKeyGetter
,
int
The stop search operator for opening the scan
stopSearchOperator
,
boolean
Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
sameStartStopPosition
,
Qualifier[][]
the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
scanQualifiers
,
Qualifier[][]
the array of Qualifiers for the look up into the hash table.
nextQualifiers
,
int
The initialCapacity for the HashTable.
initialCapacity
,
float
The loadFactor for the HashTable.
loadFactor
,
int
The maximum size for the HashTable.
maxCapacity
,
int
The 0-based column # for the hash key.
hashKeyColumn
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
boolean
If index, if used, is a backing index for a constraint.
isConstraint
,
boolean
True means open for update
forUpdate
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int indexColItem, int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getHashScanResultSet.

a hash scan generator, for ease of use at present.

public NoPutResultSet
getHashTableResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
GeneratedMethod
restriction, if any, applied to input of hash table.
singleTableRestriction
,
Qualifier[][]
Qualifier[] for look up into hash table
equijoinQualifiers
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to project out the expected result row. The signature of this method is "ExecRow projection() throws StandardException;"
projection
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
Item # for mapping of source to target columns
mapRefItem
,
boolean
Whether or not to reuse the result row.
reuseResult
,
int
Item for hash key column array
keyColItem
,
boolean
Whether or not to remove duplicates when building the hash table
removeDuplicates
,
long
Max size of in-memory hash table
maxInMemoryRowCount
,
int
initialCapacity for java.util.HashTable
initialCapacity
,
float
loadFactor for java.util.HashTable
loadFactor
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getHashTableResultSet.

A hash table result set builds a hash table on its source, applying a list of predicates, if any, to the source, when building the hash table.

public NoPutResultSet
getIndexRowToBaseRowResultSet(long
Conglomerate # for the heap.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
NoPutResultSet
the source result set, which is expected to provide rows from an index conglomerate
source
,
int
a reference to a method in the activation that creates a holder for the rows from the scan. "ExecRow rowAllocator() throws StandardException;"
resultRowAllocator
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
String
The name of the index.
indexName
,
int
A saved item for a bitImpl of columns that are referenced in the underlying heap. -1 if no item.
heapColRefItem
,
int
A saved item for a bitImpl of columns that are referenced in the underlying index and heap. -1 if no item.
allColRefItem
,
int
A saved item for a bitImpl of columns that are referenced in the underlying heap only. -1 if no item.
heapOnlyColRefItem
,
int
A saved item for a ReferencedColumnsDescriptorImpl which tell which columms are coming from the index.
indexColMapItem
,
GeneratedMethod
The restriction, if any, to be applied to the base row
restriction
,
boolean
True means to open for update
forUpdate
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
int
Number of columns in the base table
baseColumnCount
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getIndexRowToBaseRowResultSet.

An index row to base row result set gets an index row from its source and uses the RowLocation in its last column to get the row from the base conglomerate.

public ResultSet
getInsertResultSet(NoPutResultSet
the result set from which to take rows to be inserted into the target table.
source
,
GeneratedMethod
The code to compute column generation clauses if any
generationClauses
,
GeneratedMethod
The code to enforce the check constraints, if any
checkGM
,
int
Saved item for a row template used by bulk insert, or -1 if this is not a bulk insert
fullTemplate
,
String
schema name of table
schemaName
,
String
table name
tableName
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getInsertResultSet.

An insert result set simply reports that it completed, and the number of rows inserted.

public ResultSet
getInsertVTIResultSet(NoPutResultSet
the result set from which to take rows to be inserted into the target table.
source
,
NoPutResultSet
The code to instantiate the VTI, if necessary
vtiRS
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getInsertVTIResultSet.

An insert VTI result set simply reports that it completed, and the number of rows inserted.

public NoPutResultSet

Returns:

the scan operation as a result set.
getLastIndexKeyResultSet
(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The saved item for result row template
resultRowTemplate
,
long
the conglomerate of the table to be scanned.
conglomId
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getLastIndexKeyResultSet.

A last index key sresult set returns the last row from the index in question.

public NoPutResultSet
getMaterializedResultSet(NoPutResultSet
the result set input to this result set.
source
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getMaterializedResultSet.

A ResultSet which materializes the underlying ResultSet tree into a temp table on the 1st open.

public ResultSet
getMergeResultSet(NoPutResultSet
the result set from which to take rows to be drive the INSERT/UPDATE/DELETE operations.
drivingLeftJoin
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getMergeResultSet.

A MERGE result set simply reports that it completed, and the number of rows that it INSERTed/UPDATEd/DELETEdd.

public ResultSet
getMiscResultSet(Activation
the activation for this result set
activation
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getMiscResultSet.

Generic Misc result set creation.

public NoPutResultSet
getMultiProbeTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, DataValueDescriptor[]
List of values with which to probe the underlying table. Should not be null.
probeVals
,
int
Which type of sort we need for the values (ascending, descending, or none).
sortRequired
,
String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getMultiProbeTableScanResultSet.

Multi-probing scan that probes an index for specific values contained in the received probe list.

public NoPutResultSet
getNestedLoopJoinResultSet(NoPutResultSet
Outer ResultSet for join.
leftResultSet
,
int
Number of columns in the leftResultSet
leftNumCols
,
NoPutResultSet
Inner ResultSet for join.
rightResultSet
,
int
Number of columns in the rightResultSet
rightNumCols
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is "Boolean joinClause() throws StandardException;"
joinClause
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
boolean
boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
oneRowRightSide
,
boolean
boolean, whether or not the right side resides a NOT EXISTS base table
notExistsRightSide
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getNestedLoopJoinResultSet.

A nested loop left outer join result set forms a result set on top of 2 other result sets.

public NoPutResultSet
getNestedLoopLeftOuterJoinResultSet(NoPutResultSet
Outer ResultSet for join.
leftResultSet
,
int
Number of columns in the leftResultSet
leftNumCols
,
NoPutResultSet
Inner ResultSet for join.
rightResultSet
,
int
Number of columns in the rightResultSet
rightNumCols
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is "Boolean joinClause() throws StandardException;"
joinClause
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that is called if the right child returns no rows
emptyRowFun
,
boolean
Whether or not this was originally a right outer join
wasRightOuterJoin
,
boolean
boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
oneRowRightSide
,
boolean
boolean, whether or not the right side resides a NOT EXISTS base table
notExistsRightSide
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getNestedLoopLeftOuterJoinResultSet.

A nested loop join result set forms a result set on top of 2 other result sets.

public NoPutResultSet
getNormalizeResultSet(NoPutResultSet
the result set input to this result set.
source
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
int for ResultDescription (so it can be turned back into an object)
erdNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
boolean forUpdate)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getNormalizeResultSet.

REMIND: needs more description...

public NoPutResultSet
getOnceResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
GeneratedMethod
a reference to a method in the activation that is called if the source returns no rows
emptyRowFun
,
int
The type of cardinality check, if any that is required
cardinalityCheck
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The subquery number for this subquery.
subqueryNumber
,
int
The point of attachment for this subquery.
pointOfAttachment
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getOnceResultSet.

A once result set iterates over its source, raising an error if the source returns > 1 row and returning a row with all columns set to nulls if the source returns no rows.

public NoPutResultSet
getProjectRestrictResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the restriction is satisfied or not. The signature of this method is "Boolean restriction() throws StandardException;"
restriction
,
GeneratedMethod
a reference to a method in the activation that is applied to the activation's "current row" field to project out the expected result row. The signature of this method is "ExecRow projection() throws StandardException;"
projection
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that represents a constant expression (eg where 1 = 2). The signature of this method is "Boolean restriction() throws StandardException;
constantRestriction
,
int
Item # for mapping of source to target columns
mapRefItem
,
int
Item # for columns that need cloning
cloneMapItem
,
boolean
Whether or not to reuse the result row.
reuseResult
,
boolean
Whether or not this PRN does a projection
doesProjection
,
boolean
true if this PRN is used to for validating a deferred check constraint.
validatingCheckConstraint
,
String
The uuid for the table being validated.
validatingBaseTableUUIDString
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getProjectRestrictResultSet.

A project restrict result set iterates over its source, evaluating a restriction and when it is satisfied, constructing a row to return in its result set based on its projection.

public NoPutResultSet
getRaDependentTableScanResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
long
the conglomerate of the table to be scanned.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
int
The saved item for result row template.
resultRowTemplate
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. "ExecIndexRow startKeyGetter() throws StandardException;"
startKeyGetter
,
int
The start search operator for opening the scan
startSearchOperator
,
GeneratedMethod
a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. "ExecIndexRow stopKeyGetter() throws StandardException;"
stopKeyGetter
,
int
The stop search operator for opening the scan
stopSearchOperator
,
boolean
Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
sameStartStopPosition
,
Qualifier[][]
the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
qualifiers
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
boolean
If index, if used, is a backing index for a constraint.
isConstraint
,
boolean
True means open for update
forUpdate
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int indexColItem, int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
boolean
Whether or not this is a 1 row scan.
oneRowScan
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
String
Id to access the materialized temporary result set from the reference stored in the activation.
parentResultSetId
,
long
foreign key index conglomerate id.
fkIndexConglomId
,
int
saved column array object that matches the foreign key index columns and the resultset from the parent table.
fkColArrayItem
,
int
row location template
rltItem
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getRaDependentTableScanResultSet.

a referential action dependent table scan generator.

public NoPutResultSet
getRowCountResultSet(NoPutResultSet
The source result set being filtered
source
,
Activation
The activation for this result set, which provides the context for the row allocation operation
activation
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
The OFFSET parameter was specified
offsetMethod
,
GeneratedMethod
The FETCH FIRST/NEXT parameter was specified
fetchFirstMethod
,
boolean
True if the offset/fetchFirst clauses were added by JDBC LIMIT escape syntax
hasJDBClimitClause
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getRowCountResultSet.

This result sets implements the filtering needed by resultOffsetClause and fetchFirstClause.

public NoPutResultSet
getRowResultSet(Activation
the activation for this result set, against which the row operation is performed to create the result set.
activation
,
GeneratedMethod
a reference to a method in the activation that creates the expected row. "ExecRow row() throws StandardException;"
row
,
boolean
True if execution can cache the input row after it has gotten it. If the input row is constructed soley of constants or parameters, it is ok to cache this row rather than recreating it each time it is requested.
canCacheRow
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getRowResultSet.

A row result set forms a result set on a single, known row value.

public NoPutResultSet
getScalarAggregateResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
boolean
true if the source result set is in sorted order
isInSortedOrder
,
int
entry in preparedStatement's savedObjects for aggregates
aggregateItem
,
int
Ignored to allow same signature as getDistinctScalarAggregateResultSet
orderItem
,
int
a reference to a saved object that generates rows of the right size and shape for the source
rowAllocator
,
int
Ignored to allow same signature as getDistinctScalarAggregateResultSet
maxRowSize
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
boolean
Whether we know we have a single input row or not
singleInputRow
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getScalarAggregateResultSet.

A ScalarAggregateResultSet computes non-distinct scalar aggregates.

public NoPutResultSet
getScrollInsensitiveResultSet(NoPutResultSet
the result set input to this result set.
source
,
Activation
the activation for this result set, which provides the context for normalization.
activation
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The # of columns in the source row.
sourceRowWidth
,
boolean scrollable, double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getScrollInsensitiveResultSet.

A ResultSet which provides the insensitive scrolling functionality for the underlying result set by materializing the underlying ResultSet tree into a hash table while scrolling forward.

public NoPutResultSet
getSetOpResultSet(NoPutResultSet
The result set that implements the left input
leftSource
,
NoPutResultSet
The result set that implements the right input
rightSource
,
Activation
the activation for this result set
activation
,
int resultSetNumber, long optimizerEstimatedRowCount, double optimizerEstimatedCost, int
IntersectOrExceptNode.INTERSECT_OP or EXCEPT_OP
opType
,
boolean
true if the operation is an INTERSECT ALL or an EXCEPT ALL, false if the operation is an INTERSECT DISCTINCT or an EXCEPT DISCTINCT
all
,
int
The saved object index for the array of order by columns for the ordering of the left and right sources. That is, both the left and right sources have an order by clause of the form ORDER BY intermediateOrderByColumns[0],intermediateOrderByColumns[1],...
intermediateOrderByColumnsSavedObject
,
int
The saved object index for the array of source order by directions. That is, the ordering of the i'th order by column in the input is ascending if intermediateOrderByDirection[i] is 1, descending if intermediateOrderByDirection[i] is -1.
intermediateOrderByDirectionSavedObject
,
int intermediateOrderByNullsLowSavedObject)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getSetOpResultSet.

The SetOpResultSet is used to implement an INTERSECT or EXCEPT operation.

public ResultSet
public NoPutResultSet
getSortResultSet(NoPutResultSet
the result set from which to take rows to be filtered by this operation.
source
,
boolean
true if distinct SELECT list
distinct
,
boolean
true if the source result set is in sorted order
isInSortedOrder
,
int
entry in preparedStatement's savedObjects for order
orderItem
,
int
a reference to a saved object that generates rows of the right size and shape for the source
rowAllocator
,
int
the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
maxRowSize
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getSortResultSet.

A sort result set sorts its source and if requested removes duplicates.

public NoPutResultSet
getTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getTableScanResultSet.

a minimal table scan generator, for ease of use at present.

public NoPutResultSet
getUnionResultSet(NoPutResultSet
The first ResultSet whose rows go into the union
leftResultSet
,
NoPutResultSet
The second ResultSet whose rows go into the union
rightResultSet
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getUnionResultSet.

a minimal union scan generator, for ease of use at present.

public ResultSet
getUpdateResultSet(NoPutResultSet
the result set from which to take rows to be updated in the target table. This result set must contain a column which provides RowLocations that are valid in the target table, and new values to be placed in those rows.
source
,
GeneratedMethod
The code to compute column generation clauses if any
generationClauses
,
GeneratedMethod
The code to enforce the check constraints, if any
checkGM
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getUpdateResultSet.

An update result set simply reports that it completed, and the number of rows updated.

public ResultSet
getUpdateVTIResultSet(NoPutResultSet
the result set from which to take rows to be updated in the target table.
source
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getUpdateVTIResultSet.

public NoPutResultSet
getValidateCheckConstraintResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
long
the conglomerate of the table to be scanned.
conglomId
,
int
The saved item for the static conglomerate info.
scociItem
,
int
The saved item for result row template.
resultRowTemplate
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. "ExecIndexRow startKeyGetter() throws StandardException;"
startKeyGetter
,
int
The start search operator for opening the scan
startSearchOperator
,
GeneratedMethod
a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. "ExecIndexRow stopKeyGetter() throws StandardException;"
stopKeyGetter
,
int
The stop search operator for opening the scan
stopSearchOperator
,
boolean
Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
sameStartStopPosition
,
Qualifier[][]
the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
qualifiers
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
boolean
If index, if used, is a backing index for a constraint.
isConstraint
,
boolean
True means open for update
forUpdate
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int indexColItem, int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
boolean
Whether or not this is a 1 row scan.
oneRowScan
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getValidateCheckConstraintResultSet.

A table scan result set forms a result set on a scan of a table.

public NoPutResultSet
getVTIResultSet(Activation
the activation for this result set, against which the row operation is performed to create the result set.
activation
,
int
a reference to a saved object that creates the expected row.
row
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
GeneratedMethod
The GeneratedMethod for the user's constructor
constructor
,
String
The java class name for the VTI
javaClassName
,
Qualifier[][] pushedQualifiers, int
int for referenced column BitSet (so it can be turned back into an object)
erdNumber
,
boolean
Whether or not VTI is a version 2 VTI.
version2
,
boolean reuseablePs, int ctcNumber, boolean
Whether or not VTI is a target VTI.
isTarget
,
int scanIsolationLevel, double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
,
boolean
True if this is a Derby-style table function
isDerbyStyleTableFunction
,
int
Which saved object contains the return type (a multi-set) serialized as a byte array
returnTypeNumber
,
int
Which saved object contains the projection for a RestrictedVTI
vtiProjectionNumber
,
int
Which saved object contains the restriction for a RestrictedVTI
vtiRestrictionNumber
,
String
Name of the schema holding the table function.
vtiSchema
,
String
Name of the table function.
vtiName
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getVTIResultSet.

A VTI result set wraps a user supplied result set.

public NoPutResultSet
getWindowResultSet(Activation
Activation
activation
,
NoPutResultSet
The result set input to this result set.
source
,
int
A reference to a saved object that generates rows of the right size and shape for the source.
rowAllocator
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
Int for ResultDescription (so it can be turned back into an object)
erdNumber
,
GeneratedMethod
The restriction, if any, to be applied to the base row
restriction
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

Implements org.apache.derby.iapi.sql.execute.ResultSetFactory.getWindowResultSet.

A OLAP window on top of a regular result set.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait