ResultColumn
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| protected long | |
| private boolean | |
| protected boolean | |
| protected boolean | |
| private int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public ResultColumn | addColumn(TableName tableName, String columnName, DataTypeDescriptor dts)
Add a column to the list given a table name, column name, and data type. |
| pack-priv void | |
| pack-priv void | addResultColumn(ResultColumn
The ResultColumn to add to the list resultColumn)Add a ResultColumn (at this point, ResultColumn or AllResultColumn) to the list |
| pack-priv void | adjustVirtualColumnIds(int
The size of the increment. adjust)Walk the list and adjust the virtualColumnIds in the ResultColumns by the specified amount. |
| pack-priv boolean | Returns: Whether or not all of the RC.expressions are columns in the source result set.The source ResultSet. sourceRS)Determine if all of the RC.expressions are columns in the source result set. |
| pack-priv int | Returns: -1 if all of the top level CRs in the RCL are not ColumnReferences from the same table, else the tableNumberReturn whether or not all of the RCs in the list whose expressions are ColumnReferences are from the same table. |
| pack-priv void | appendResultColumns(ResultColumnList
The ResultColumnList to be appended resultColumns, boolean Whether or not this is a descructive copy
from resultColumns destructiveCopy)Append a given ResultColumnList to this one, resetting the virtual column ids in the appended portion. |
| pack-priv void | bindExpressions(FromList
The FROM list for the query this
expression is in, for binding columns. fromList, SubqueryList The subquery list being built as we find SubqueryNodes subqueryList, List<AggregateNode> The aggregate list being built as we find AggregateNodes aggregates)Bind the expressions in this ResultColumnList. |
| pack-priv void | bindResultColumnsByName(TableDescriptor
The descriptor for the table targetTableDescriptor)Bind the result columns by their names. |
| pack-priv FormatableBitSet | Returns: A FormatableBitSet representing the set of columns with respect to the tableThe descriptor for the table being
updated or inserted into targetTableDescriptor, DMLStatementNode DMLStatementNode containing this list, null if no duplicate checking is to be done statement)Bind the result columns by their names. |
| pack-priv void | bindResultColumnsByName(ResultColumnList
The full RCL for the target table fullRCL, FromVTI targetVTI, DMLStatementNode DMLStatementNode containing this list statement)Bind the result columns by their names. |
| pack-priv void | bindResultColumnsByPosition(TableDescriptor
The descriptor for the table being
inserted into targetTableDescriptor)Bind the result columns by ordinal position. |
| pack-priv void | |
| pack-priv void | bindUntypedNullsToResultColumns(ResultColumnList
The ResultColumnList with the types to bind to. bindingRCL)Bind any untyped null nodes to the types in the given ResultColumnList. |
| public ExecRow | Returns: an empty row of the correct size and shape.Build an empty index row for the given conglomerate. |
| public ExecRow | Returns: an empty row of the correct size and shape.Build an empty row with the size and shape of the ResultColumnList. |
| pack-priv ExecRowBuilder | Returns: an instance that produces rows of the same shape as this result column lista bit map that tells which columns in the
source result set that are used, or referencedCols, boolean null if all are usedwhether to skip virtual columns whose
source is the immediate child result set skipPropagatedCols)Build an |
| pack-priv ExecRowBuilder | |
| pack-priv void | checkColumnUpdateability(ExecPreparedStatement
the statement that owns the cursor cursorStmt, String The cursor's name. cursorName)Verify that all of the columns in the SET clause of a positioned update appear in the cursor's FOR UPDATE OF list. |
| pack-priv void | |
| pack-priv void | checkStorableExpressions(ResultColumnList toStore)
Verify that all the result columns have expressions that are storable for them. |
| pack-priv void | checkStorableExpressions()
Verify that all the result columns have expressions that are storable for them. |
| pack-priv void | |
| pack-priv void | |
| private void | collapseVirtualColumnIdGap(int
id of the column which was just removed. gap)Adjust virtualColumnId values due to result column removal This method is called when a duplicate column has been detected and removed from the list. |
| pack-priv boolean | Returns: true if any column in list is updatable, else falseReturn true if some columns in this list are updatable. |
| pack-priv boolean | Returns: true means all the columns match their expressions, false means at least one column does not match its expressionCheck whether the column lengths and types of the result columns match the expressions under those columns. |
| pack-priv boolean | |
| private void | commonCodeForUpdatableByCursor(List<String> updateColumns, boolean dealingWithSelectResultColumnList)
dealingWithSelectResultColumnList true means we are dealing with ResultColumnList for a select sql. |
| pack-priv ResultColumnList | Returns: The compacted RCL if compaction occurred, otherwise return this RCL.Whether or not the scan that the RCL
belongs to is for update w/o a column list positionedUpdate, boolean Whether or not caller always wants a new RCL always)Create a new, compacted RCL based on the referenced RCs in this list. |
| pack-priv boolean | Returns: Whether or not this RCL contains an AllResultColumn.Return whether or not this RCL contains an AllResultColumn. |
| pack-priv void | copyColumnsToNewList(ResultColumnList
The list to copy to, targetList, FormatableBitSet 1 based bitMap we copy columns associated with set bits. copyList)Copy the RCs from this list to the supplied target list. |
| pack-priv ResultColumnList | Returns: None.Create a shallow copy of a ResultColumnList and its ResultColumns. |
| public void | |
| pack-priv void | copyReferencedColumnsToNewList(ResultColumnList
The list to copy to targetList)Copy the referenced RCs from this list to the supplied target list. |
| pack-priv void | copyResultColumnNames(ResultColumnList
The ResultColumnList from which to copy
the column names nameList)Copy the result column names from the given ResultColumnList to this ResultColumnList. |
| pack-priv int | Returns: The number of RCs in the list that are referenced.Count the number of RCs in the list that are referenced. |
| pack-priv void | createListFromResultSetMetaData(ResultSetMetaData
The ResultSetMetaData. rsmd, TableName The TableName for the BCNs. tableName, String The name of the VTI javaClassName)Generate an RCL to match the contents of a ResultSetMetaData. |
| private void | |
| pack-priv void | doProjection()
Project out any unreferenced ResultColumns from the list and reset the virtual column ids in the referenced ResultColumns. |
| pack-priv void | |
| pack-priv ResultColumnList | Returns: A new ResultColumnList expanded to include all columns in the given table.The TableDescriptor for the table in question td, TableName The name of the table as given in the query tableName)Expand this ResultColumnList by adding all columns from the given table that are not in this list. |
| pack-priv void | exportNames(String[]
String[] to hold the column names. columnNames)Export the result column names to the passed in String[]. |
| pack-priv ResultColumn | Returns: ResultColumn The parent ResultColumnThe child ResultColumn childRC)Given a ResultColumn at the next deepest level in the tree, search this RCL for its parent ResultColumn. |
| pack-priv ResultColumn | Returns: the column that matches that name, or NULL if pull-up neededThe ResultColumn to get from the list columnName, TableName The table name on the OrderByColumn, if any tableName)For order by, get a ResultColumn that matches the specified columnName. |
| pack-priv void | forbidOverrides(ResultColumnList sourceRSRCL)
check if any autoincrement or generated columns exist in the result column list. |
| pack-priv void | forbidOverrides(ResultColumnList sourceRSRCL, boolean defaultsWereReplaced)
check if any autoincrement or generated columns exist in the result column list. |
| private void | genCreateRow(ExpressionClassBuilder
The ACB. acb, LocalField The field for the new row. field, String The method to call. rowAllocatorMethod, String The row type. rowAllocatorType, int The number of columns in the row. numCols)Generate the code to create an empty row in the constructor. |
| pack-priv void | generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built acb, MethodBuilder The method for the generated code to go into mb)Overrides org. Generate the code to place the columns' values into a row variable named "r". |
| pack-priv void | generateCore(ExpressionClassBuilder acb, MethodBuilder mb, boolean genNulls)
Generate the code to place the columns' values into a row variable named "r". |
| pack-priv void | generateEvaluatedRow(ExpressionClassBuilder acb, MethodBuilder userExprFun, boolean genNulls, boolean forMatchingClause)
Generate the code for a method (userExprFun) which creates a row and, column by column, stuffs it with the evaluated expressions of our ResultColumns. |
| pack-priv void | generateNulls(ActivationClassBuilder acb, MethodBuilder mb)
Generate the code to place the columns' values into a row variable named "r". |
| pack-priv void | genVirtualColumnNodes(ResultSetNode
ResultSetNode that is source of value sourceResultSet, ResultColumnList sourceResultColumnList)Walk the list and replace ResultColumn.expression with a new VirtualColumnNode. |
| pack-priv void | genVirtualColumnNodes(ResultSetNode
ResultSetNode that is source of value sourceResultSet, ResultColumnList sourceResultColumnList, boolean Whether or not to mark the underlying RCs
as referenced markReferenced)Walk the list and replace ResultColumn.expression with a new VirtualColumnNode. |
| pack-priv ResultColumn | Returns: the column that matches that name.The ColumnReference to resolve cr, String Exposed table name for FromTable exposedTableName, boolean Also consider columns that are generated.
One example of this is group by where columns are added to the select list
if they are referenced in the group by but are not present in the select
list. considerGeneratedColumns)Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
| pack-priv String[] | Returns: the array of stringsGet an array of strings for all the columns in this RCL. |
| pack-priv int[] | Returns: the array of stringsGet an array of column positions (1-based) for all the columns in this RCL. |
| pack-priv FormatableBitSet | Returns: the FormatableBitSetGet a FormatableBitSet of the columns referenced in this rcl |
| protected boolean | getCountMismatchAllowed()
Return whether or not a count mismatch is allowed between this RCL, as a derived column list, and an underlying RCL. |
| pack-priv ResultColumnList | Returns: A list of the join columns from this listA list of the join columns. joinColumns)Get the join columns from this list. |
| pack-priv ResultColumn | Returns: the column at that position, null if out of rangeThe ResultColumn to get from the list (1-based) position)Get a ResultColumn from a column position (1-based) in the list, null if out of range (for order by). |
| pack-priv ResultColumn | Returns: the column that matches that name.The ResultColumn to get from the list columnName, TableName The table name on the OrderByColumn, if any tableName, int The tableNumber corresponding to the FromTable with the
exposed name of tableName, if tableName != null. tableNumber, OrderByColumn The OrderByColumn we're binding. obc)For order by column bind, get a ResultColumn that matches the specified columnName. |
| pack-priv int | |
| pack-priv int | getPosition(String
Name of the column name, int 0 (for 0-based ids) or 1 (for 1-based ids) basis)Get the position of first result column with the given name. |
| pack-priv FormatableBitSet | Returns: The FormatableBitSet representing the referenced RCs.Whether or not the scan that the RCL
belongs to is for update w/o a column list positionedUpdate, boolean Whether or not caller always wants a non-null FormatableBitSet if
all RCs are referenced. always, boolean If true, only set bit if expression is a BaseColumnNode,
otherwise set bit for all referenced RCs. onlyBCNs)Generate a FormatableBitSet representing the columns that are referenced in this RCL. |
| pack-priv ResultColumn | Returns: the column at that position.The ResultColumn to get from the list (1-based) position)Get a ResultColumn from a column position (1-based) in the list |
| pack-priv ResultColumn | Returns: The ResultColumn in this RCL whose source is column colNum in result set rsn. That ResultColumn's position w.r.t to this RCL is also returned via the whichRC parameter. If no match is found, return null and leave whichRC untouched.The column position (w.r.t rsn) for which we're searching colNum, ResultSetNode The result set node for which we're searching. rsn, int[] whichRC)Take a column position and a ResultSetNode and find the ResultColumn in this RCL whose source result set is the same as the received RSN and whose column position is the same as the received column position. |
| pack-priv ResultColumn | Returns: the column that matches that name.The ResultColumn to get from the list columnName)Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
| pack-priv ResultColumn | Returns: the column that matches that name.The ResultColumn to get from the list columnName, boolean True if we should mark this column as referenced. markIfReferenced)Get a ResultColumn that matches the specified columnName. |
| public ResultColumn | getResultColumn(int
the table number to look for tableNumber, int the column number to look for columnNumber, String name of the desired column columnName)Return a result column, if any found, which contains in its expression/{VCN,CR} chain a result column with the given columnNumber from a FromTable with the given tableNumber. |
| pack-priv ResultColumn | Returns: the column that matches that name.Qualifying name for the column columnsTableName, String The ResultColumn to get from the list columnName)Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
| pack-priv ResultColumn[] | Returns: The sorted array.Return an array that contains references to the columns in this list sorted by position. |
| pack-priv int[] | getStreamStorableColIds(int
the number of heap columns heapColCount)Return an array holding the 0 based heap offsets of the StreamStorable columns in this ResultColumnList. |
| pack-priv int | |
| pack-priv boolean | Returns: boolean Whether or not the type information is consistentVerify that all ResultColumns and their expressions have type information and that the type information between the respective RCs and expressions matches. |
| pack-priv void | |
| pack-priv boolean | Returns: boolean Whether or not this RCL can be flattened out of a tree.Return whether or not this RCL can be flattened out of a tree. |
| pack-priv boolean | Returns: boolean Whether or not there is an exact UNION type match on the 2 RCLs.The other RCL. otherRCL)Do the 2 RCLs have the same type and length. |
| private ResultColumn | |
| private ResultColumn | |
| pack-priv ResultColumnDescriptor[] | Returns: A ResultDescription for this ResultSetNode.Make a ResultDescription for use in a ResultSet. |
| pack-priv ResultColumnList. | Returns: Array representiong mapping of RCs to source RCs.Map the source columns to these columns. |
| pack-priv void | |
| pack-priv void | markColumnsInSelectListUpdatableByCursor(List<String>
A list representing the columns
to be updated. updateColumns)Mark all the columns in the select sql that this result column list represents as updatable if they match the columns in the given update column list. |
| protected void | |
| pack-priv void | markUpdatableByCursor()
Mark all the (base) columns in this list as updatable by a positioned update statement. |
| pack-priv void | markUpdatableByCursor(List<String>
A list representing the columns
to be updated. updateColumns)Mark as updatable all the columns in this result column list that match the columns in the given update column list |
| pack-priv void | |
| pack-priv void | markUpdated(ResultColumnList
A ResultColumnList representing the columns
to be updated. updateColumns)Mark as updatable all the columns in this result column list that match the columns in the given update column list. |
| pack-priv void | nameAllResultColumns()
Generate (unique across the entire statement) column names for those ResultColumns in this list which are not named. |
| private RowLocation | newRowLocationTemplate()
Create a row location template of the right type for the source conglomerate. |
| pack-priv boolean | Returns: true if this RCL is a No-Op projection of the given RCL.The ResultColumnList of the child result set. childRCL)Determine whether this RCL is a No-Op projection of the given RCL. |
| private int | |
| pack-priv int | |
| public void | populate(TableDescriptor
describes the table table, int[] column positions in that table (1-based) columnIDs)Build this ResultColumnList from a table description and an array of column IDs. |
| pack-priv void | preprocess(int
Number of tables in the DML Statement numTables, FromList FromList from outer query block outerFromList, SubqueryList SubqueryList from outer query block outerSubqueryList, PredicateList PredicateList from outer query block outerPredicateList)Preprocess the expression trees under the RCL. |
| pack-priv void | propagateDCLInfo(ResultColumnList
The derived column list derivedRCL, String The table name for the FromTable tableName)Validate the derived column list (DCL) and propagate the info from the list to the final ResultColumnList. |
| pack-priv void | |
| pack-priv void | recordColumnReferences(int[]
int[] for column ids idArray, int 0 (for 0-based ids) or 1 (for 1-based ids) basis)Record the column ids of the referenced columns in the specified array. |
| pack-priv void | recordColumnReferences(boolean[]
boolean[] for columns colArray1, JBitSet[] JBitSet[] for tables tableColMap, int Table number of column references tableNumber)Record the top level ColumnReferences in the specified array and table map This is useful when checking for uniqueness conditions. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the underlying expression. |
| pack-priv void | |
| pack-priv void | removeJoinColumns(ResultColumnList
The list of join columns joinColumns)Remove the columns which are join columns (in the joinColumns RCL) from this list. |
| pack-priv void | |
| pack-priv void | replaceOrForbidDefaults(TableDescriptor
The TableDescriptor for the target table. ttd, ResultColumnList The RCL for the target table. tcl, boolean true if allowed allowDefaults)Replace any DEFAULTs with the associated tree for the default if allowed, or flag. |
| pack-priv void | |
| pack-priv boolean | Returns: Whether or not the same result row can be used for all rows returned by the associated ResultSet.Return whether or not the same result row can be used for all rows returned by the associated ResultSet. |
| protected void | setCountMismatchAllowed(boolean
Whether or not a mismatch is allowed. allowed)Set the value of whether or not a count mismatch is allowed between this RCL, as a derived column list, and an underlying RCL. |
| pack-priv void | setDefault(ResultColumn rc, ColumnDescriptor cd, DefaultInfoImpl defaultInfo)
Set the default in a ResultColumn |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | setResultSetNumber(int
The resultSetNumber resultSetNumber)Set the resultSetNumber in all of the ResultColumns. |
| pack-priv void | setUnionResultExpression(ResultColumnList
RCL from other side of the UNION. otherRCL, int The tableNumber for the UNION. tableNumber, int The nesting level for the UNION. level, String "UNION", "INTERSECT", or "EXCEPT" operatorName)Set up the result expressions for a UNION, INTERSECT, or EXCEPT: o Verify union type compatiblity o Get dominant type for result (type + max length + nullability) o Create a new ColumnReference with dominant type and name of from this RCL and make that the new expression. |
| public int[] | Returns: a sorted arrayReturn an array of all my column positions, sorted in ascending order. |
| private static boolean | |
| public String | Returns: This object as a StringOverrides org. Convert this object to a String. |
| private boolean | unionCompatible(ValueNode left, ValueNode right)
Return true if the types of two expressions are union compatible. |
| pack-priv boolean | Returns: true if the column is updatableThe position of the column in question columnPosition)Returns true if the given column position is for a column that will be or could be updated by the positioned update of a cursor. |
| private static void | updateArrays(int[] mapArray, boolean[] cloneMap, Map<Integer, Integer> seenMap, ResultColumn rc, int index)
|
| public boolean | Returns: True if this column list contains any of the given columnsAn array of column positions columns)Does the column list contain any of the given column positions that are updated? |
| pack-priv void | |
| pack-priv String | Returns: String The 1st column name, if any, that is not in the list.Verify that all of the column names in this list are contained within the ColumnDefinitionNodes within the TableElementList. |
| pack-priv String | Returns: String The first duplicate column name, if any.Raise an error for any generated column names. errForGenCols)Check the uniqueness of the column names within a column list. |
| pack-priv int | Returns: the number of columns that will be visible during execution. During compilation we can add columns for a group by/order by but these to an RCL but these are projected out during query execution.
|