--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.execute.ResultSetFactory\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.execute;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.sql.ResultDescription;\r
+import org.apache.derby.iapi.sql.ResultSet;\r
+import org.apache.derby.iapi.sql.Activation;\r
+\r
+import org.apache.derby.iapi.services.loader.GeneratedMethod;\r
+\r
+import org.apache.derby.iapi.store.access.Qualifier;\r
+import org.apache.derby.iapi.types.DataValueDescriptor;\r
+\r
+/**\r
+ * ResultSetFactory provides a wrapper around all of\r
+ * the result sets needed in an execution implementation.\r
+ * <p>\r
+ * For the activations to avoid searching for this module\r
+ * in their execute methods, the base activation supertype\r
+ * should implement a method that does the lookup and salts\r
+ * away this factory for the activation to use as it needs it.\r
+ *\r
+ */\r
+public interface ResultSetFactory {\r
+ /**\r
+ Module name for the monitor's module locating system.\r
+ */\r
+ String MODULE = "org.apache.derby.iapi.sql.execute.ResultSetFactory";\r
+\r
+ //\r
+ // DDL operations\r
+ //\r
+\r
+ /**\r
+ Generic DDL result set creation.\r
+\r
+ @param activation the activation for this result set\r
+\r
+ @return ResultSet A wrapper result set to run the Execution-time\r
+ logic.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ ResultSet getDDLResultSet(Activation activation)\r
+ throws StandardException;\r
+\r
+\r
+ //\r
+ // MISC operations\r
+ //\r
+\r
+ /**\r
+ Generic Misc result set creation.\r
+\r
+ @param activation the activation for this result set\r
+\r
+ @return ResultSet A wrapper result set to run the Execution-time\r
+ logic.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ ResultSet getMiscResultSet(Activation activation)\r
+ throws StandardException;\r
+\r
+ //\r
+ // Transaction operations\r
+ //\r
+ /**\r
+\r
+ @param activation the activation for this result set\r
+\r
+ @return ResultSet A wrapper result set to run the Execution-time\r
+ logic.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ ResultSet getSetTransactionResultSet(Activation activation) \r
+ throws StandardException;\r
+\r
+ //\r
+ // DML statement operations\r
+ //\r
+ /**\r
+ An insert result set simply reports that it completed, and\r
+ the number of rows inserted. It does not return rows.\r
+ The insert has been completed once the\r
+ insert result set is available.\r
+\r
+ @param source the result set from which to take rows to\r
+ be inserted into the target table.\r
+ @param checkGM The code to enforce the check constraints, if any\r
+ @return the insert operation as a result set.\r
+ @exception StandardException thrown when unable to perform the insert\r
+ */\r
+ ResultSet getInsertResultSet(NoPutResultSet source, \r
+ GeneratedMethod checkGM)\r
+ throws StandardException;\r
+\r
+ /**\r
+ An insert VTI result set simply reports that it completed, and\r
+ the number of rows inserted. It does not return rows.\r
+ The insert has been completed once the\r
+ insert result set is available.\r
+\r
+ @param source the result set from which to take rows to\r
+ be inserted into the target table.\r
+ @param vtiRS The code to instantiate the VTI, if necessary\r
+ @return the insert VTI operation as a result set.\r
+ @exception StandardException thrown when unable to perform the insert\r
+ */\r
+ ResultSet getInsertVTIResultSet(NoPutResultSet source, \r
+ NoPutResultSet vtiRS)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A delete VTI result set simply reports that it completed, and\r
+ the number of rows deleted. It does not return rows.\r
+ The delete has been completed once the\r
+ delete result set is available.\r
+\r
+ @param source the result set from which to take rows to\r
+ be inserted into the target table.\r
+ @return the delete VTI operation as a result set.\r
+ @exception StandardException thrown when unable to perform the insert\r
+ */\r
+ ResultSet getDeleteVTIResultSet(NoPutResultSet source)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A delete result set simply reports that it completed, and\r
+ the number of rows deleted. It does not return rows.\r
+ The delete has been completed once the\r
+ delete result set is available.\r
+\r
+ @param source the result set from which to take rows to\r
+ be deleted from the target table. This result set must\r
+ contain one column which provides RowLocations that are\r
+ valid in the target table.\r
+ @return the delete operation as a result set.\r
+ @exception StandardException thrown when unable to perform the delete\r
+ */\r
+ ResultSet getDeleteResultSet(NoPutResultSet source)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A delete Cascade result set simply reports that it completed, and\r
+ the number of rows deleted. It does not return rows.\r
+ The delete has been completed once the\r
+ delete result set is available.\r
+\r
+ @param source the result set from which to take rows to\r
+ be deleted from the target table.\r
+ @param constantActionItem a constant action saved object reference\r
+ @param dependentResultSets an array of DeleteCascade Resultsets\r
+ for the current table referential action\r
+ dependents tables.\r
+ @param resultSetId an Id which is used to store the refence\r
+ to the temporary result set created of\r
+ the materilized rows.Dependent table resultsets\r
+ uses the same id to access their parent temporary result sets.\r
+ @return the delete operation as a delete cascade result set.\r
+ @exception StandardException thrown when unable to perform the delete\r
+ */\r
+ ResultSet getDeleteCascadeResultSet(NoPutResultSet source,\r
+ int constantActionItem,\r
+ ResultSet[] dependentResultSets, \r
+ String resultSetId)\r
+ throws StandardException;\r
+\r
+ /**\r
+ An update result set simply reports that it completed, and\r
+ the number of rows updated. It does not return rows.\r
+ The update has been completed once the\r
+ update result set is available.\r
+\r
+ @param source the result set from which to take rows to be \r
+ updated in the target table. This result set must contain \r
+ a column which provides RowLocations that are valid in the \r
+ target table, and new values to be placed in those rows.\r
+ @param checkGM The code to enforce the check constraints, if any\r
+ @return the update operation as a result set.\r
+ @exception StandardException thrown when unable to perform the update\r
+ */\r
+ ResultSet getUpdateResultSet(NoPutResultSet source, \r
+ GeneratedMethod checkGM)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * @param source the result set from which to take rows to be \r
+ * updated in the target table.\r
+ * @return the update operation as a result set.\r
+ * @exception StandardException thrown on error\r
+ */\r
+ public ResultSet getUpdateVTIResultSet(NoPutResultSet source)\r
+ throws StandardException;\r
+\r
+ /**\r
+ An update result set simply reports that it completed, and\r
+ the number of rows updated. It does not return rows.\r
+ The update has been completed once the\r
+ update result set is available.\r
+\r
+ @param source the result set from which to take rows to be \r
+ updated in the target table. This result set must contain \r
+ a column which provides RowLocations that are valid in the \r
+ target table, and new values to be placed in those rows.\r
+ @param checkGM The code to enforce the check constraints, if any\r
+ @param constantActionItem a constant action saved object reference\r
+ @param rsdItem result Description, saved object id. \r
+ @return the update operation as a result set.\r
+ @exception StandardException thrown when unable to perform the update\r
+ */\r
+ ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source, \r
+ GeneratedMethod checkGM,\r
+ int constantActionItem,\r
+ int rsdItem)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A call statement result set simply reports that it completed. \r
+ It does not return rows.\r
+\r
+ @param methodCall a reference to a method in the activation\r
+ for the method call\r
+ @param activation the activation for this result set\r
+\r
+ @return the call statement operation as a result set.\r
+ @exception StandardException thrown when unable to perform the call statement\r
+ */\r
+ ResultSet getCallStatementResultSet(GeneratedMethod methodCall,\r
+ Activation activation) \r
+ throws StandardException;\r
+\r
+ //\r
+ // Query expression operations\r
+ //\r
+\r
+ /**\r
+ A project restrict result set iterates over its source,\r
+ evaluating a restriction and when it is satisfied,\r
+ constructing a row to return in its result set based on\r
+ its projection.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param restriction a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to determine whether the restriction is satisfied or not.\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean restriction() throws StandardException;\r
+ </verbatim>\r
+ @param projection a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to project out the expected result row.\r
+ The signature of this method is\r
+ <verbatim>\r
+ ExecRow projection() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param constantRestriction a reference to a method in the activation\r
+ that represents a constant expression (eg where 1 = 2).\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean restriction() throws StandardException;\r
+ </verbatim>\r
+ @param mapArrayItem Item # for mapping of source to target columns\r
+ @param reuseResult Whether or not to reuse the result row.\r
+ @param doesProjection Whether or not this PRN does a projection\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the project restrict operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,\r
+ GeneratedMethod restriction, \r
+ GeneratedMethod projection, int resultSetNumber,\r
+ GeneratedMethod constantRestriction,\r
+ int mapArrayItem,\r
+ boolean reuseResult,\r
+ boolean doesProjection,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) throws StandardException;\r
+\r
+ /**\r
+ A hash table result set builds a hash table on its source,\r
+ applying a list of predicates, if any, to the source,\r
+ when building the hash table. It then does a look up into\r
+ the hash table on a probe.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param singleTableRestriction restriction, if any, applied to\r
+ input of hash table.\r
+ @param equijoinQualifiers Qualifier[] for look up into hash table\r
+ @param projection a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to project out the expected result row.\r
+ The signature of this method is\r
+ <verbatim>\r
+ ExecRow projection() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param mapRefItem Item # for mapping of source to target columns\r
+ @param reuseResult Whether or not to reuse the result row.\r
+ @param keyColItem Item for hash key column array\r
+ @param removeDuplicates Whether or not to remove duplicates when building the hash table\r
+ @param maxInMemoryRowCount Max size of in-memory hash table\r
+ @param initialCapacity initialCapacity for java.util.HashTable\r
+ @param loadFactor loadFactor for java.util.HashTable\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the project restrict operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getHashTableResultSet(NoPutResultSet source,\r
+ GeneratedMethod singleTableRestriction, \r
+ Qualifier[][] equijoinQualifiers,\r
+ GeneratedMethod projection, int resultSetNumber,\r
+ int mapRefItem,\r
+ boolean reuseResult,\r
+ int keyColItem,\r
+ boolean removeDuplicates,\r
+ long maxInMemoryRowCount,\r
+ int initialCapacity,\r
+ float loadFactor,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A sort result set sorts its source and if requested removes\r
+ duplicates. It will generate the entire result when open, and\r
+ then return it a row at a time.\r
+ <p>\r
+ If passed aggregates it will do scalar or vector aggregate\r
+ processing. A list of aggregator information is passed\r
+ off of the PreparedStatement's savedObjects. Aggregation\r
+ and SELECT DISTINCT cannot be processed in the same sort.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param distinct true if distinct SELECT list\r
+ @param isInSortedOrder true if the source result set is in sorted order\r
+ @param orderItem entry in preparedStatement's savedObjects for order\r
+ @param rowAllocator a reference to a method in the activation\r
+ that generates rows of the right size and shape for the source\r
+ @param rowSize the size of the row that is allocated by rowAllocator.\r
+ size should be the maximum size of the sum of all the datatypes.\r
+ user type are necessarily approximated\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the distinct operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getSortResultSet(NoPutResultSet source,\r
+ boolean distinct, \r
+ boolean isInSortedOrder,\r
+ int orderItem,\r
+ GeneratedMethod rowAllocator, \r
+ int rowSize,\r
+ int resultSetNumber, \r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A ScalarAggregateResultSet computes non-distinct scalar aggregates.\r
+ It will compute the aggregates when open.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param isInSortedOrder true if the source result set is in sorted order\r
+ @param aggregateItem entry in preparedStatement's savedObjects for aggregates\r
+ @param orderingItem Ignored to allow same signature as getDistinctScalarAggregateResultSet\r
+ @param rowAllocator a reference to a method in the activation\r
+ that generates rows of the right size and shape for the source\r
+ @param rowSize Ignored to allow same signature as getDistinctScalarAggregateResultSet\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param singleInputRow Whether we know we have a single input row or not\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the scalar aggregation operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getScalarAggregateResultSet(NoPutResultSet source,\r
+ boolean isInSortedOrder,\r
+ int aggregateItem,\r
+ int orderingItem,\r
+ GeneratedMethod rowAllocator, \r
+ int rowSize,\r
+ int resultSetNumber, \r
+ boolean singleInputRow,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A DistinctScalarAggregateResultSet computes scalar aggregates when \r
+ at least one of them is a distinct aggregate.\r
+ It will compute the aggregates when open.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param isInSortedOrder true if the source result set is in sorted order\r
+ @param aggregateItem entry in preparedStatement's savedObjects for aggregates\r
+ @param orderingItem entry in preparedStatement's savedObjects for order\r
+ @param rowAllocator a reference to a method in the activation\r
+ that generates rows of the right size and shape for the source\r
+ @param rowSize the size of the row that is allocated by rowAllocator.\r
+ size should be the maximum size of the sum of all the datatypes.\r
+ user type are necessarily approximated\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param singleInputRow Whether we know we have a single input row or not\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the scalar aggregation operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getDistinctScalarAggregateResultSet(NoPutResultSet source,\r
+ boolean isInSortedOrder,\r
+ int aggregateItem,\r
+ int orderingItem,\r
+ GeneratedMethod rowAllocator, \r
+ int rowSize,\r
+ int resultSetNumber, \r
+ boolean singleInputRow,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A GroupedAggregateResultSet computes non-distinct grouped aggregates.\r
+ It will compute the aggregates when open.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param isInSortedOrder true if the source result set is in sorted order\r
+ @param aggregateItem entry in preparedStatement's savedObjects for aggregates\r
+ @param orderingItem Ignored to allow same signature as getDistinctScalarAggregateResultSet\r
+ @param rowAllocator a reference to a method in the activation\r
+ that generates rows of the right size and shape for the source\r
+ @param rowSize Ignored to allow same signature as getDistinctScalarAggregateResultSet\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the scalar aggregation operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getGroupedAggregateResultSet(NoPutResultSet source,\r
+ boolean isInSortedOrder,\r
+ int aggregateItem,\r
+ int orderingItem,\r
+ GeneratedMethod rowAllocator, \r
+ int rowSize,\r
+ int resultSetNumber, \r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A DistinctGroupedAggregateResultSet computes scalar aggregates when \r
+ at least one of them is a distinct aggregate.\r
+ It will compute the aggregates when open.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param isInSortedOrder true if the source result set is in sorted order\r
+ @param aggregateItem entry in preparedStatement's savedObjects for aggregates\r
+ @param orderingItem entry in preparedStatement's savedObjects for order\r
+ @param rowAllocator a reference to a method in the activation\r
+ that generates rows of the right size and shape for the source\r
+ @param rowSize the size of the row that is allocated by rowAllocator.\r
+ size should be the maximum size of the sum of all the datatypes.\r
+ user type are necessarily approximated\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the scalar aggregation operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getDistinctGroupedAggregateResultSet(NoPutResultSet source,\r
+ boolean isInSortedOrder,\r
+ int aggregateItem,\r
+ int orderingItem,\r
+ GeneratedMethod rowAllocator, \r
+ int rowSize,\r
+ int resultSetNumber, \r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ An any result set iterates over its source,\r
+ returning a row with all columns set to nulls\r
+ if the source returns no rows.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param emptyRowFun a reference to a method in the activation\r
+ that is called if the source returns no rows\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param subqueryNumber The subquery number for this subquery.\r
+ @param pointOfAttachment The point of attachment for this subquery.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the any operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getAnyResultSet(NoPutResultSet source,\r
+ GeneratedMethod emptyRowFun, int resultSetNumber,\r
+ int subqueryNumber, int pointOfAttachment,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A once result set iterates over its source,\r
+ raising an error if the source returns > 1 row and\r
+ returning a row with all columns set to nulls\r
+ if the source returns no rows.\r
+\r
+ @param source the result set from which to take rows to be \r
+ filtered by this operation.\r
+ @param emptyRowFun a reference to a method in the activation\r
+ that is called if the source returns no rows\r
+ @param cardinalityCheck The type of cardinality check, if any that\r
+ is required\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param subqueryNumber The subquery number for this subquery.\r
+ @param pointOfAttachment The point of attachment for this subquery.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the once operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getOnceResultSet(NoPutResultSet source,\r
+ GeneratedMethod emptyRowFun,\r
+ int cardinalityCheck, int resultSetNumber, \r
+ int subqueryNumber, int pointOfAttachment,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A row result set forms a result set on a single, known row value.\r
+ It is used to turn constant rows into result sets for use in\r
+ the result set paradigm.\r
+ The row can be constructed when it is requested from the\r
+ result set.\r
+\r
+ @param activation the activation for this result set,\r
+ against which the row operation is performed to\r
+ create the result set.\r
+ @param row a reference to a method in the activation\r
+ that creates the expected row.\r
+ <verbatim>\r
+ ExecRow row() throws StandardException;\r
+ </verbatim>\r
+ @param canCacheRow True if execution can cache the input row\r
+ after it has gotten it. If the input row is constructed soley\r
+ of constants or parameters, it is ok to cache this row rather\r
+ than recreating it each time it is requested.\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the row as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getRowResultSet(Activation activation, GeneratedMethod row, \r
+ boolean canCacheRow,\r
+ int resultSetNumber,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A VTI result set wraps a user supplied result set.\r
+\r
+ @param activation the activation for this result set,\r
+ against which the row operation is performed to\r
+ create the result set.\r
+ @param row a reference to a method in the activation\r
+ that creates the expected row.\r
+ <verbatim>\r
+ ExecRow row() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param constructor The GeneratedMethod for the user's constructor\r
+ @param javaClassName The java class name for the VTI\r
+ @param erdNumber int for referenced column BitSet \r
+ (so it can be turned back into an object)\r
+ @param version2 Whether or not VTI is a version 2 VTI.\r
+ @param isTarget Whether or not VTI is a target VTI.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the row as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getVTIResultSet(Activation activation, GeneratedMethod row,\r
+ int resultSetNumber,\r
+ GeneratedMethod constructor,\r
+ String javaClassName,\r
+ Qualifier[][] pushedQualifiers,\r
+ int erdNumber,\r
+ boolean version2, boolean reuseablePs,\r
+ int ctcNumber,\r
+ boolean isTarget,\r
+ int scanIsolationLevel,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A hash result set forms a result set on a hash table built on a scan\r
+ of a table.\r
+ The rows are put into the hash table on the 1st open.\r
+ <p>\r
+\r
+ @param activation the activation for this result set,\r
+ which provides the context for the row allocation operation.\r
+ @param conglomId the conglomerate of the table to be scanned.\r
+ @param scociItem The saved item for the static conglomerate info.\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the rows from the scan.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param startKeyGetter a reference to a method in the activation\r
+ that gets the start key indexable row for the scan. Null\r
+ means there is no start key.\r
+ <verbatim>\r
+ ExecIndexRow startKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param startSearchOperator The start search operator for opening\r
+ the scan\r
+ @param stopKeyGetter a reference to a method in the activation\r
+ that gets the stop key indexable row for the scan. Null means\r
+ there is no stop key.\r
+ <verbatim>\r
+ ExecIndexRow stopKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param stopSearchOperator The stop search operator for opening\r
+ the scan\r
+ @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter\r
+ (Exact match search.)\r
+ @param scanQualifiers the array of Qualifiers for the scan.\r
+ Null or an array length of zero means there are no qualifiers.\r
+ @param nextQualifiers the array of Qualifiers for the look up into the hash table.\r
+ @param initialCapacity The initialCapacity for the HashTable.\r
+ @param loadFactor The loadFactor for the HashTable.\r
+ @param maxCapacity The maximum size for the HashTable.\r
+ @param hashKeyColumn The 0-based column # for the hash key.\r
+ @param tableName The full name of the table \r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @param indexName The name of the index, if one used to access table.\r
+ @param isConstraint If index, if used, is a backing index for a constraint.\r
+ @param forUpdate True means open for update\r
+ @param colRefItem An saved item for a bitSet of columns that\r
+ are referenced in the underlying table. -1 if\r
+ no item.\r
+ @param lockMode The lock granularity to use (see\r
+ TransactionController in access)\r
+ @param tableLocked Whether or not the table is marked as using table locking\r
+ (in sys.systables)\r
+ @param isolationLevel Isolation level (specified or not) to use on scans\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the table scan operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getHashScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem, \r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ GeneratedMethod startKeyGetter,\r
+ int startSearchOperator,\r
+ GeneratedMethod stopKeyGetter,\r
+ int stopSearchOperator,\r
+ boolean sameStartStopPosition,\r
+ Qualifier[][] scanQualifiers,\r
+ Qualifier[][] nextQualifiers,\r
+ int initialCapacity,\r
+ float loadFactor,\r
+ int maxCapacity,\r
+ int hashKeyColumn,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ boolean forUpdate,\r
+ int colRefItem,\r
+ int indexColItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A distinct scan result set pushes duplicate elimination into\r
+ the scan.\r
+ <p>\r
+\r
+ @param activation the activation for this result set,\r
+ which provides the context for the row allocation operation.\r
+ @param conglomId the conglomerate of the table to be scanned.\r
+ @param scociItem The saved item for the static conglomerate info.\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the rows from the scan.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param hashKeyColumn The 0-based column # for the hash key.\r
+ @param tableName The full name of the table\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @param indexName The name of the index, if one used to access table.\r
+ @param isConstraint If index, if used, is a backing index for a constraint.\r
+ @param colRefItem An saved item for a bitSet of columns that\r
+ are referenced in the underlying table. -1 if\r
+ no item.\r
+ @param lockMode The lock granularity to use (see\r
+ TransactionController in access)\r
+ @param tableLocked Whether or not the table is marked as using table locking\r
+ (in sys.systables)\r
+ @param isolationLevel Isolation level (specified or not) to use on scans\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the table scan operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getDistinctScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem, \r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ int hashKeyColumn,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ int colRefItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A table scan result set forms a result set on a scan\r
+ of a table.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+ <p>\r
+ This form of the table scan operation is simple, and is\r
+ to be used when there are no predicates to be passed down\r
+ to the scan to limit its scope on the target table.\r
+\r
+ @param conglomId the conglomerate of the table to be scanned.\r
+ @param scociItem The saved item for the static conglomerate info.\r
+ @param activation the activation for this result set,\r
+ which provides the context for the row allocation operation.\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the result row of the scan. May\r
+ be a partial row.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param startKeyGetter a reference to a method in the activation\r
+ that gets the start key indexable row for the scan. Null\r
+ means there is no start key.\r
+ <verbatim>\r
+ ExecIndexRow startKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param startSearchOperator The start search operator for opening\r
+ the scan\r
+ @param stopKeyGetter a reference to a method in the activation\r
+ that gets the stop key indexable row for the scan. Null means\r
+ there is no stop key.\r
+ <verbatim>\r
+ ExecIndexRow stopKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param stopSearchOperator The stop search operator for opening\r
+ the scan\r
+ @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter\r
+ (Exact match search.)\r
+ @param qualifiers the array of Qualifiers for the scan.\r
+ Null or an array length of zero means there are no qualifiers.\r
+ @param tableName The full name of the table\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @param indexName The name of the index, if one used to access table.\r
+ @param isConstraint If index, if used, is a backing index for a constraint.\r
+ @param forUpdate True means open for update\r
+ @param colRefItem An saved item for a bitSet of columns that\r
+ are referenced in the underlying table. -1 if\r
+ no item.\r
+ @param lockMode The lock granularity to use (see\r
+ TransactionController in access)\r
+ @param tableLocked Whether or not the table is marked as using table locking\r
+ (in sys.systables)\r
+ @param isolationLevel Isolation level (specified or not) to use on scans\r
+ @param oneRowScan Whether or not this is a 1 row scan.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+\r
+ @return the table scan operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getTableScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem,\r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ GeneratedMethod startKeyGetter,\r
+ int startSearchOperator,\r
+ GeneratedMethod stopKeyGetter,\r
+ int stopSearchOperator,\r
+ boolean sameStartStopPosition,\r
+ Qualifier[][] qualifiers,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ boolean forUpdate,\r
+ int colRefItem,\r
+ int indexColItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ boolean oneRowScan,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A table scan result set forms a result set on a scan\r
+ of a table.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+ <p>\r
+ This form of the table scan operation is simple, and is\r
+ to be used when there are no predicates to be passed down\r
+ to the scan to limit its scope on the target table.\r
+\r
+ @param conglomId the conglomerate of the table to be scanned.\r
+ @param scociItem The saved item for the static conglomerate info.\r
+ @param activation the activation for this result set,\r
+ which provides the context for the row allocation operation.\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the result row of the scan. May\r
+ be a partial row.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param startKeyGetter a reference to a method in the activation\r
+ that gets the start key indexable row for the scan. Null\r
+ means there is no start key.\r
+ <verbatim>\r
+ ExecIndexRow startKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param startSearchOperator The start search operator for opening\r
+ the scan\r
+ @param stopKeyGetter a reference to a method in the activation\r
+ that gets the stop key indexable row for the scan. Null means\r
+ there is no stop key.\r
+ <verbatim>\r
+ ExecIndexRow stopKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param stopSearchOperator The stop search operator for opening\r
+ the scan\r
+ @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter\r
+ (Exact match search.)\r
+ @param qualifiers the array of Qualifiers for the scan.\r
+ Null or an array length of zero means there are no qualifiers.\r
+ @param tableName The full name of the table\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @param indexName The name of the index, if one used to access table.\r
+ @param isConstraint If index, if used, is a backing index for a constraint.\r
+ @param forUpdate True means open for update\r
+ @param colRefItem An saved item for a bitSet of columns that\r
+ are referenced in the underlying table. -1 if\r
+ no item.\r
+ @param lockMode The lock granularity to use (see\r
+ TransactionController in access)\r
+ @param tableLocked Whether or not the table is marked as using table locking\r
+ (in sys.systables)\r
+ @param isolationLevel Isolation level (specified or not) to use on scans\r
+ @param rowsPerRead The number of rows to read per fetch.\r
+ @param oneRowScan Whether or not this is a 1 row scan.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+\r
+ @return the table scan operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ NoPutResultSet getBulkTableScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem,\r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ GeneratedMethod startKeyGetter,\r
+ int startSearchOperator,\r
+ GeneratedMethod stopKeyGetter,\r
+ int stopSearchOperator,\r
+ boolean sameStartStopPosition,\r
+ Qualifier[][] qualifiers,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ boolean forUpdate,\r
+ int colRefItem,\r
+ int indexColItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ int rowsPerRead,\r
+ boolean oneRowScan,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A multi-probe result set, used for probing an index with one or more\r
+ target values (probeValues) and returning the matching rows. This\r
+ type of result set is useful for IN lists as it allows us to avoid\r
+ scannning an entire, potentially very large, index for a mere handful\r
+ of rows (DERBY-47).\r
+\r
+ All arguments are the same as for TableScanResultSet, plus the\r
+ following:\r
+\r
+ @param probeVals List of values with which to probe the underlying\r
+ table. Should not be null.\r
+ @param sortRequired Which type of sort we need for the values\r
+ (ascending, descending, or none).\r
+ */\r
+ NoPutResultSet getMultiProbeTableScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem,\r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ GeneratedMethod startKeyGetter,\r
+ int startSearchOperator,\r
+ GeneratedMethod stopKeyGetter,\r
+ int stopSearchOperator,\r
+ boolean sameStartStopPosition,\r
+ Qualifier[][] qualifiers,\r
+ DataValueDescriptor [] probeVals,\r
+ int sortRequired,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ boolean forUpdate,\r
+ int colRefItem,\r
+ int indexColItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ boolean oneRowScan,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ An index row to base row result set gets an index row from its source\r
+ and uses the RowLocation in its last column to get the row from the\r
+ base conglomerate.\r
+ <p>\r
+\r
+ @param conglomId Conglomerate # for the heap.\r
+ @param scoci The saved item for the static conglomerate info.\r
+ @param source the source result set, which is expected to provide\r
+ rows from an index conglomerate\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the rows from the scan.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param indexName The name of the index.\r
+ @param heapColRefItem A saved item for a bitImpl of columns that\r
+ are referenced in the underlying heap. -1 if\r
+ no item.\r
+ @param allColRefItem A saved item for a bitImpl of columns\r
+ that are referenced in the underlying\r
+ index and heap. -1 if no item.\r
+ @param heapOnlyColRefItem A saved item for a bitImpl of\r
+ columns that are referenced in the\r
+ underlying heap only. -1 if no item.\r
+\r
+ @param indexColMapItem A saved item for a ReferencedColumnsDescriptorImpl\r
+ which tell which columms are coming from the index.\r
+ @param restriction The restriction, if any, to be applied to the base row\r
+ @param forUpdate True means to open for update\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+\r
+ @return the index row to base row operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getIndexRowToBaseRowResultSet(\r
+ long conglomId,\r
+ int scoci,\r
+ NoPutResultSet source,\r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ String indexName,\r
+ int heapColRefItem,\r
+ int allColRefItem,\r
+ int heapOnlyColRefItem,\r
+ int indexColMapItem,\r
+ GeneratedMethod restriction,\r
+ boolean forUpdate,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A nested loop left outer join result set forms a result set on top of\r
+ 2 other result sets.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+ <p>\r
+ This form of the nested loop join operation is simple, and is\r
+ to be used when there are no join predicates to be passed down\r
+ to the join to limit its scope on the right ResultSet.\r
+\r
+ @param leftResultSet Outer ResultSet for join.\r
+ @param leftNumCols Number of columns in the leftResultSet\r
+ @param rightResultSet Inner ResultSet for join.\r
+ @param rightNumCols Number of columns in the rightResultSet\r
+ @param joinClause a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to determine whether the joinClause is satisfied or not.\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean joinClause() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param oneRowRightSide boolean, whether or not the right side returns\r
+ a single row. (No need to do 2nd next() if it does.)\r
+ @param notExistsRightSide boolean, whether or not the right side resides a\r
+ NOT EXISTS base table\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @return the nested loop join operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getNestedLoopJoinResultSet(NoPutResultSet leftResultSet,\r
+ int leftNumCols,\r
+ NoPutResultSet rightResultSet,\r
+ int rightNumCols,\r
+ GeneratedMethod joinClause,\r
+ int resultSetNumber,\r
+ boolean oneRowRightSide,\r
+ boolean notExistsRightSide,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ String userSuppliedOptimizerOverrides)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A hash join.\r
+\r
+ @param leftResultSet Outer ResultSet for join.\r
+ @param leftNumCols Number of columns in the leftResultSet\r
+ @param rightResultSet Inner ResultSet for join.\r
+ @param rightNumCols Number of columns in the rightResultSet\r
+ @param joinClause a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to determine whether the joinClause is satisfied or not.\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean joinClause() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param oneRowRightSide boolean, whether or not the right side returns\r
+ a single row. (No need to do 2nd next() if it does.)\r
+ @param notExistsRightSide boolean, whether or not the right side resides a\r
+ NOT EXISTS base table\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @return the nested loop join operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getHashJoinResultSet(NoPutResultSet leftResultSet,\r
+ int leftNumCols,\r
+ NoPutResultSet rightResultSet,\r
+ int rightNumCols,\r
+ GeneratedMethod joinClause,\r
+ int resultSetNumber,\r
+ boolean oneRowRightSide,\r
+ boolean notExistsRightSide,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ String userSuppliedOptimizerOverrides)\r
+ throws StandardException;\r
+\r
+\r
+ /**\r
+ A nested loop join result set forms a result set on top of\r
+ 2 other result sets.\r
+ The rows can be constructed as they are requested from the\r
+ result set.\r
+ <p>\r
+ This form of the nested loop join operation is simple, and is\r
+ to be used when there are no join predicates to be passed down\r
+ to the join to limit its scope on the right ResultSet.\r
+\r
+ @param leftResultSet Outer ResultSet for join.\r
+ @param leftNumCols Number of columns in the leftResultSet\r
+ @param rightResultSet Inner ResultSet for join.\r
+ @param rightNumCols Number of columns in the rightResultSet\r
+ @param joinClause a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to determine whether the joinClause is satisfied or not.\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean joinClause() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param emptyRowFun a reference to a method in the activation\r
+ that is called if the right child returns no rows\r
+ @param wasRightOuterJoin Whether or not this was originally a right outer join\r
+ @param oneRowRightSide boolean, whether or not the right side returns\r
+ a single row. (No need to do 2nd next() if it does.)\r
+ @param notExistsRightSide boolean, whether or not the right side resides a\r
+ NOT EXISTS base table\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @return the nested loop join operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftResultSet,\r
+ int leftNumCols,\r
+ NoPutResultSet rightResultSet,\r
+ int rightNumCols,\r
+ GeneratedMethod joinClause,\r
+ int resultSetNumber,\r
+ GeneratedMethod emptyRowFun,\r
+ boolean wasRightOuterJoin,\r
+ boolean oneRowRightSide,\r
+ boolean notExistsRightSide,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ String userSuppliedOptimizerOverrides)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A left outer join using a hash join.\r
+\r
+ @param leftResultSet Outer ResultSet for join.\r
+ @param leftNumCols Number of columns in the leftResultSet\r
+ @param rightResultSet Inner ResultSet for join.\r
+ @param rightNumCols Number of columns in the rightResultSet\r
+ @param joinClause a reference to a method in the activation\r
+ that is applied to the activation's "current row" field\r
+ to determine whether the joinClause is satisfied or not.\r
+ The signature of this method is\r
+ <verbatim>\r
+ Boolean joinClause() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param emptyRowFun a reference to a method in the activation\r
+ that is called if the right child returns no rows\r
+ @param wasRightOuterJoin Whether or not this was originally a right outer join\r
+ @param oneRowRightSide boolean, whether or not the right side returns\r
+ a single row. (No need to do 2nd next() if it does.)\r
+ @param notExistsRightSide boolean, whether or not the right side resides a\r
+ NOT EXISTS base table\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @return the nested loop join operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet,\r
+ int leftNumCols,\r
+ NoPutResultSet rightResultSet,\r
+ int rightNumCols,\r
+ GeneratedMethod joinClause,\r
+ int resultSetNumber,\r
+ GeneratedMethod emptyRowFun,\r
+ boolean wasRightOuterJoin,\r
+ boolean oneRowRightSide,\r
+ boolean notExistsRightSide,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ String userSuppliedOptimizerOverrides)\r
+ throws StandardException;\r
+\r
+ /**\r
+ A ResultSet which materializes the underlying ResultSet tree into a \r
+ temp table on the 1st open. All subsequent "scans" of this ResultSet\r
+ will return results from the temp table.\r
+\r
+ @param source the result set input to this result set.\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the materialization operation as a result set.\r
+\r
+ @exception StandardException Thrown on failure\r
+ */\r
+ NoPutResultSet getMaterializedResultSet(NoPutResultSet source, \r
+ int resultSetNumber,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A ResultSet which provides the insensitive scrolling functionality\r
+ for the underlying result set by materializing the underlying ResultSet \r
+ tree into a hash table while scrolling forward.\r
+\r
+ @param source the result set input to this result set.\r
+ @param activation the activation for this result set,\r
+ which provides the context for normalization.\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param sourceRowWidth The # of columns in the source row.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the materialization operation as a result set.\r
+\r
+ @exception StandardException Thrown on failure\r
+ */\r
+ NoPutResultSet getScrollInsensitiveResultSet(NoPutResultSet source, Activation activation, \r
+ int resultSetNumber,\r
+ int sourceRowWidth,\r
+ boolean scrollable,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost) \r
+ throws StandardException;\r
+\r
+ /**\r
+ REMIND: needs more description...\r
+\r
+ @param source the result set input to this result set.\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param erdNumber int for ResultDescription \r
+ (so it can be turned back into an object)\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @return the normalization operation as a result set.\r
+\r
+ @exception StandardException Thrown on failure\r
+ */\r
+ NoPutResultSet getNormalizeResultSet(NoPutResultSet source, \r
+ int resultSetNumber, int erdNumber,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ boolean forUpdate) \r
+ throws StandardException;\r
+\r
+ /**\r
+ A current of result set forms a result set on the\r
+ current row of an open cursor.\r
+ It is used to perform positioned operations such as\r
+ positioned update and delete, using the result set paradigm.\r
+\r
+ @param cursorName the name of the cursor providing the row.\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ */\r
+ NoPutResultSet getCurrentOfResultSet(String cursorName, Activation activation, \r
+ int resultSetNumber);\r
+\r
+ /**\r
+ * The Union interface is used to evaluate the union (all) of two ResultSets.\r
+ * (Any duplicate elimination is performed above this ResultSet.)\r
+ *\r
+ * Forms a ResultSet returning the union of the rows in two source\r
+ * ResultSets. The column types in source1 and source2 are assumed to be\r
+ * the same.\r
+ *\r
+ * @param source1 The first ResultSet whose rows go into the union\r
+ * @param source2 The second ResultSet whose rows go into the\r
+ * union\r
+ * @param resultSetNumber The resultSetNumber for the ResultSet\r
+ * @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ * optimizer\r
+ * @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ *\r
+ * @return A ResultSet from which the caller can get the union\r
+ * of the two source ResultSets.\r
+ *\r
+ * @exception StandardException Thrown on failure\r
+ */\r
+ NoPutResultSet getUnionResultSet(NoPutResultSet source1,\r
+ NoPutResultSet source2,\r
+ int resultSetNumber,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost)\r
+ throws StandardException;\r
+\r
+\r
+ /**\r
+ * The SetOpResultSet is used to implement an INTERSECT or EXCEPT operation.\r
+ * It selects rows from two ordered input result sets.\r
+ *\r
+ * @param leftSource The result set that implements the left input\r
+ * @param rightSource The result set that implements the right input\r
+ * @param activation the activation for this result set\r
+ * @param resultSetNumber\r
+ * @param optimizerEstimatedRowCount\r
+ * @param optimizerEstimatedCost\r
+ * @param opType IntersectOrExceptNode.INTERSECT_OP or EXCEPT_OP\r
+ * @param all true if the operation is an INTERSECT ALL or an EXCEPT ALL,\r
+ * false if the operation is an INTERSECT DISCTINCT or an EXCEPT DISCTINCT\r
+ * @param intermediateOrderByColumnsSavedObject The saved object index for the array of order by columns for the\r
+ * ordering of the left and right sources. That is, both the left and right sources have an order by\r
+ * clause of the form ORDER BY intermediateOrderByColumns[0],intermediateOrderByColumns[1],...\r
+ * @param intermediateOrderByDirectionSavedObject The saved object index for the array of source\r
+ * order by directions. That is, the ordering of the i'th order by column in the input is ascending\r
+ * if intermediateOrderByDirection[i] is 1, descending if intermediateOrderByDirection[i] is -1.\r
+ *\r
+ * @return A ResultSet from which the caller can get the INTERSECT or EXCEPT\r
+ *\r
+ * @exception StandardException Thrown on failure\r
+ */\r
+ NoPutResultSet getSetOpResultSet( NoPutResultSet leftSource,\r
+ NoPutResultSet rightSource,\r
+ Activation activation, \r
+ int resultSetNumber,\r
+ long optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ int opType,\r
+ boolean all,\r
+ int intermediateOrderByColumnsSavedObject,\r
+ int intermediateOrderByDirectionSavedObject)\r
+ throws StandardException;\r
+ \r
+ \r
+ //\r
+ // Misc operations\r
+ //\r
+\r
+\r
+\r
+ /**\r
+ * A last index key result set returns the last row from\r
+ * the index in question. It is used as an ajunct to max().\r
+ *\r
+ * @param activation the activation for this result set,\r
+ * which provides the context for the row allocation operation.\r
+ * @param resultSetNumber The resultSetNumber for the ResultSet\r
+ * @param resultRowAllocator a reference to a method in the activation\r
+ * that creates a holder for the result row of the scan. May\r
+ * be a partial row. <verbatim>\r
+ * ExecRow rowAllocator() throws StandardException; </verbatim>\r
+ * @param conglomId the conglomerate of the table to be scanned.\r
+ * @param tableName The full name of the table\r
+ * @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ * @param indexName The name of the index, if one used to access table.\r
+ * @param colRefItem An saved item for a bitSet of columns that\r
+ * are referenced in the underlying table. -1 if\r
+ * no item.\r
+ * @param lockMode The lock granularity to use (see\r
+ * TransactionController in access)\r
+ * @param tableLocked Whether or not the table is marked as using table locking\r
+ * (in sys.systables)\r
+ * @param isolationLevel Isolation level (specified or not) to use on scans\r
+ * @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ * optimizer\r
+ * @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ *\r
+ * @return the scan operation as a result set.\r
+ *\r
+ * @exception StandardException thrown when unable to create the\r
+ * result set\r
+ */\r
+ NoPutResultSet getLastIndexKeyResultSet\r
+ (\r
+ Activation activation,\r
+ int resultSetNumber,\r
+ GeneratedMethod resultRowAllocator,\r
+ long conglomId,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ int colRefItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost\r
+ ) throws StandardException;\r
+\r
+\r
+ /**\r
+ A Dependent table scan result set forms a result set on a scan\r
+ of a dependent table for the rows that got materilized \r
+ on the scan of its parent table and if the row being deleted\r
+ on parent table has a reference in the dependent table.\r
+\r
+ @param activation the activation for this result set,\r
+ which provides the context for the row allocation operation.\r
+ @param conglomId the conglomerate of the table to be scanned.\r
+ @param scociItem The saved item for the static conglomerate info.\r
+ @param resultRowAllocator a reference to a method in the activation\r
+ that creates a holder for the result row of the scan. May\r
+ be a partial row.\r
+ <verbatim>\r
+ ExecRow rowAllocator() throws StandardException;\r
+ </verbatim>\r
+ @param resultSetNumber The resultSetNumber for the ResultSet\r
+ @param startKeyGetter a reference to a method in the activation\r
+ that gets the start key indexable row for the scan. Null\r
+ means there is no start key.\r
+ <verbatim>\r
+ ExecIndexRow startKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param startSearchOperator The start search operator for opening\r
+ the scan\r
+ @param stopKeyGetter a reference to a method in the activation\r
+ that gets the stop key indexable row for the scan. Null means\r
+ there is no stop key.\r
+ <verbatim>\r
+ ExecIndexRow stopKeyGetter() throws StandardException;\r
+ </verbatim>\r
+ @param stopSearchOperator The stop search operator for opening\r
+ the scan\r
+ @param sameStartStopPosition Re-use the startKeyGetter for the stopKeyGetter\r
+ (Exact match search.)\r
+ @param qualifiers the array of Qualifiers for the scan.\r
+ Null or an array length of zero means there are no qualifiers.\r
+ @param tableName The full name of the table\r
+ @param userSuppliedOptimizerOverrides Overrides specified by the user on the sql\r
+ @param indexName The name of the index, if one used to access table.\r
+ @param isConstraint If index, if used, is a backing index for a constraint.\r
+ @param forUpdate True means open for update\r
+ @param colRefItem An saved item for a bitSet of columns that\r
+ are referenced in the underlying table. -1 if\r
+ no item.\r
+ @param lockMode The lock granularity to use (see\r
+ TransactionController in access)\r
+ @param tableLocked Whether or not the table is marked as using table locking\r
+ (in sys.systables)\r
+ @param isolationLevel Isolation level (specified or not) to use on scans\r
+ @param oneRowScan Whether or not this is a 1 row scan.\r
+ @param optimizerEstimatedRowCount Estimated total # of rows by\r
+ optimizer\r
+ @param optimizerEstimatedCost Estimated total cost by optimizer\r
+ @param parentResultSetId Id to access the materlized temporary result\r
+ set from the refence stored in the activation.\r
+ @param fkIndexConglomId foreign key index conglomerate id.\r
+ @param fkColArrayItem saved column array object that matches the foreign key index\r
+ columns and the resultset from the parent table.\r
+ @param rltItem row location template\r
+\r
+ @return the table scan operation as a result set.\r
+ @exception StandardException thrown when unable to create the\r
+ result set\r
+ */\r
+ public NoPutResultSet getRaDependentTableScanResultSet(\r
+ Activation activation,\r
+ long conglomId,\r
+ int scociItem, \r
+ GeneratedMethod resultRowAllocator,\r
+ int resultSetNumber,\r
+ GeneratedMethod startKeyGetter,\r
+ int startSearchOperator,\r
+ GeneratedMethod stopKeyGetter,\r
+ int stopSearchOperator,\r
+ boolean sameStartStopPosition,\r
+ Qualifier[][] qualifiers,\r
+ String tableName,\r
+ String userSuppliedOptimizerOverrides,\r
+ String indexName,\r
+ boolean isConstraint,\r
+ boolean forUpdate,\r
+ int colRefItem,\r
+ int indexColItem,\r
+ int lockMode,\r
+ boolean tableLocked,\r
+ int isolationLevel,\r
+ boolean oneRowScan,\r
+ double optimizerEstimatedRowCount,\r
+ double optimizerEstimatedCost,\r
+ String parentResultSetId,\r
+ long fkIndexConglomId,\r
+ int fkColArrayItem,\r
+ int rltItem)\r
+ throws StandardException;\r
+}\r