|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.QueryTreeNodeVector
org.apache.derby.impl.sql.compile.ResultColumnList
public class ResultColumnList
A ResultColumnList is the target list of a SELECT, INSERT, or UPDATE.
ResultColumn
Nested Class Summary | |
---|---|
class |
ResultColumnList.ColumnMapping
|
Field Summary | |
---|---|
protected long |
conglomerateId
|
private boolean |
countMismatchAllowed
|
protected boolean |
forUpdate
|
protected boolean |
indexRow
|
private int |
initialListSize
|
(package private) int |
orderBySelect
|
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
Constructor Summary | |
---|---|
ResultColumnList()
|
Method Summary | |
---|---|
void |
addColumn(TableName tableName,
java.lang.String columnName,
DataTypeDescriptor dts)
Add a column to the list given a tablename, columnname, and datatype. |
void |
addRCForRID()
Add an RC to the end of the list for the RID from an index. |
void |
addResultColumn(ResultColumn resultColumn)
Add a ResultColumn (at this point, ResultColumn or AllResultColumn) to the list |
void |
adjustVirtualColumnIds(int adjust)
Walk the list and adjust the virtualColumnIds in the ResultColumns by the specified amount. |
(package private) boolean |
allExpressionsAreColumns(ResultSetNode sourceRS)
Determine if all of the RC.expressions are columns in the source result set. |
(package private) int |
allTopCRsFromSameTable()
Return whether or not all of the RCs in the list whose expressions are ColumnReferences are from the same table. |
void |
appendResultColumns(ResultColumnList resultColumns,
boolean destructiveCopy)
Append a given ResultColumnList to this one, resetting the virtual column ids in the appended portion. |
void |
bindExpressions(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind the expressions in this ResultColumnList. |
void |
bindResultColumnsByName(ResultColumnList fullRCL,
FromVTI targetVTI,
DMLStatementNode statement)
Bind the result columns by their names. |
void |
bindResultColumnsByName(TableDescriptor targetTableDescriptor)
Bind the result columns by their names. |
FormatableBitSet |
bindResultColumnsByName(TableDescriptor targetTableDescriptor,
DMLStatementNode statement)
Bind the result columns by their names. |
void |
bindResultColumnsByPosition(TableDescriptor targetTableDescriptor)
Bind the result columns by ordinal position. |
void |
bindResultColumnsToExpressions()
Bind the result columns to the expressions that live under them. |
void |
bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
Bind any untyped null nodes to the types in the given ResultColumnList. |
ExecRow |
buildEmptyIndexRow(TableDescriptor td,
ConglomerateDescriptor cd,
StoreCostController scc,
DataDictionary dd)
Build an empty index row for the given conglomerate. |
ExecRow |
buildEmptyRow()
Build an empty row with the size and shape of the ResultColumnList. |
void |
checkColumnUpdateability(java.lang.String[] ucl,
java.lang.String cursorName)
Verify that all of the columns in the SET clause of a positioned update appear in the cursor's FOR UPDATE OF list. |
(package private) void |
checkForInvalidDefaults()
Walk the RCL and check for DEFAULTs. |
(package private) void |
checkStorableExpressions()
Verify that all the result columns have expressions that are storable for them. |
(package private) void |
checkStorableExpressions(ResultColumnList toStore)
Verify that all the result columns have expressions that are storable for them. |
void |
clearColumnReferences()
Clear the column references from the RCL. |
void |
clearTableNames()
|
private void |
collapseVirtualColumnIdGap(int 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. |
(package private) boolean |
columnTypesAndLengthsMatch()
Check whether the column lengths and types of the result columns match the expressions under those columns. |
(package private) boolean |
columnTypesAndLengthsMatch(ResultColumnList otherRCL)
|
private void |
commonCodeForUpdatableByCursor(java.util.Vector updateColumns,
boolean dealingWithSelectResultColumnList)
dealingWithSelectResultColumnList true means we are dealing with ResultColumnList for a select sql. |
(package private) ResultColumnList |
compactColumns(boolean positionedUpdate,
boolean always)
Create a new, compacted RCL based on the referenced RCs in this list. |
boolean |
containsAllResultColumn()
Return whether or not this RCL contains an AllResultColumn. |
void |
copyColumnsToNewList(ResultColumnList targetList,
FormatableBitSet copyList)
Copy the RCs from this list to the supplied target list. |
ResultColumnList |
copyListAndObjects()
Create a shallow copy of a ResultColumnList and its ResultColumns. |
void |
copyOrderBySelect(ResultColumnList src)
|
void |
copyReferencedColumnsToNewList(ResultColumnList targetList)
Copy the referenced RCs from this list to the supplied target list. |
(package private) void |
copyResultColumnNames(ResultColumnList nameList)
Copy the result column names from the given ResultColumnList to this ResultColumnList. |
int |
countReferencedColumns()
Count the number of RCs in the list that are referenced. |
void |
createListFromResultSetMetaData(java.sql.ResultSetMetaData rsmd,
TableName tableName,
java.lang.String javaClassName)
Generate an RCL to match the contents of a ResultSetMetaData. |
private void |
decOrderBySelect()
|
void |
disablePrivilegeCollection()
Triggers, constraints and views get executed with their definer's privileges and they can exist in the system only if their definers' still have all the privileges to creeate them. |
void |
doProjection()
Project out any unreferenced ResultColumns from the list and reset the virtual column ids in the referenced ResultColumns. |
void |
expandAllsAndNameColumns(FromList fromList)
Expand any *'s in the ResultColumnList. |
ResultColumnList |
expandToAll(TableDescriptor td,
TableName tableName)
Expand this ResultColumnList by adding all columns from the given table that are not in this list. |
void |
exportNames(java.lang.String[] columnNames)
Export the result column names to the passed in String[]. |
ResultColumn |
findParentResultColumn(ResultColumn childRC)
Given a ResultColumn at the next deepest level in the tree, search this RCL for its parent ResultColumn. |
ResultColumn |
findResultColumnForOrderBy(java.lang.String columnName,
TableName tableName)
For order by, get a ResultColumn that matches the specified columnName. |
void |
forbidOverrides(ResultColumnList sourceRSRCL)
check if any autoincrement or generated columns exist in the result column list. |
private void |
genCreateRow(ExpressionClassBuilder acb,
LocalField field,
java.lang.String rowAllocatorMethod,
java.lang.String rowAllocatorType,
int numCols)
Generate the code to create an empty row in the constructor. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Generate the code to place the columns' values into a row variable named "r". |
(package private) void |
generateCore(ExpressionClassBuilder acb,
MethodBuilder mb,
boolean genNulls)
Generate the code to place the columns' values into a row variable named "r". |
(package private) void |
generateHolder(ExpressionClassBuilder acb,
MethodBuilder mb)
Generates a row with the size and shape of the ResultColumnList. |
(package private) void |
generateHolder(ExpressionClassBuilder acb,
MethodBuilder mb,
FormatableBitSet referencedCols,
FormatableBitSet propagatedCols)
Generates a row with the size and shape of the ResultColumnList. |
(package private) MethodBuilder |
generateHolderMethod(ExpressionClassBuilder acb,
FormatableBitSet referencedCols,
FormatableBitSet propagatedCols)
|
(package private) void |
generateNulls(ActivationClassBuilder acb,
MethodBuilder mb)
Generate the code to place the columns' values into a row variable named "r". |
void |
genVirtualColumnNodes(ResultSetNode sourceResultSet,
ResultColumnList sourceResultColumnList)
Walk the list and replace ResultColumn.expression with a new VirtualColumnNode. |
void |
genVirtualColumnNodes(ResultSetNode sourceResultSet,
ResultColumnList sourceResultColumnList,
boolean markReferenced)
Walk the list and replace ResultColumn.expression with a new VirtualColumnNode. |
ResultColumn |
getAtMostOneResultColumn(ColumnReference cr,
java.lang.String exposedTableName,
boolean considerGeneratedColumns)
Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
java.lang.String[] |
getColumnNames()
Get an array of strings for all the columns in this RCL. |
int[] |
getColumnPositions(TableDescriptor td)
Get an array of column positions (1-based) for all the columns in this RCL. |
FormatableBitSet |
getColumnReferenceMap()
Get 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. |
(package private) ResultColumnList |
getJoinColumns(ResultColumnList joinColumns)
Get the join columns from this list. |
ResultColumn |
getOrderByColumn(int position)
Get a ResultColumn from a column position (1-based) in the list, null if out of range (for order by). |
ResultColumn |
getOrderByColumnToBind(java.lang.String columnName,
TableName tableName,
int tableNumber,
OrderByColumn obc)
For order by column bind, get a ResultColumn that matches the specified columnName. |
int |
getOrderBySelect()
|
int |
getPosition(java.lang.String name,
int basis)
Get the position of first result column with the given name. |
(package private) FormatableBitSet |
getReferencedFormatableBitSet(boolean positionedUpdate,
boolean always,
boolean onlyBCNs)
Generate a FormatableBitSet representing the columns that are referenced in this RCL. |
ResultColumn |
getResultColumn(int position)
Get a ResultColumn from a column position (1-based) in the list |
ResultColumn |
getResultColumn(int tableNumber,
int columnNumber,
java.lang.String 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. |
ResultColumn |
getResultColumn(int colNum,
ResultSetNode 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. |
ResultColumn |
getResultColumn(java.lang.String columnName)
Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
ResultColumn |
getResultColumn(java.lang.String columnName,
boolean markIfReferenced)
Get a ResultColumn that matches the specified columnName. |
ResultColumn |
getResultColumn(java.lang.String columnsTableName,
java.lang.String columnName)
Get a ResultColumn that matches the specified columnName and mark the ResultColumn as being referenced. |
(package private) ResultColumn[] |
getSortedByPosition()
Return an array that contains references to the columns in this list sorted by position. |
int[] |
getStreamStorableColIds(int heapColCount)
Return an array holding the 0 based heap offsets of the StreamStorable columns in this ResultColumnList. |
int |
getTotalColumnSize()
Get the size of all the columns added together. |
boolean |
hasConsistentTypeInfo()
Verify that all ResultColumns and their expressions have type information and that the type information between the respective RCs and expressions matches. |
void |
incOrderBySelect()
|
boolean |
isCloneable()
Return whether or not this RCL can be flattened out of a tree. |
boolean |
isExactTypeAndLengthMatch(ResultColumnList otherRCL)
Do the 2 RCLs have the same type & length. |
private ResultColumn |
makeColumnFromName(java.lang.String columnName)
|
private ResultColumn |
makeColumnReferenceFromName(TableName tableName,
java.lang.String columnName)
|
ResultColumnDescriptor[] |
makeResultDescriptors()
Make a ResultDescription for use in a ResultSet. |
(package private) ResultColumnList.ColumnMapping |
mapSourceColumns()
Map the source columns to these columns. |
void |
markAllUnreferenced()
Walk the list and mark all RCs as unreferenced. |
(package private) void |
markColumnsInSelectListUpdatableByCursor(java.util.Vector 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 |
markInitialSize()
|
(package private) void |
markUpdatableByCursor()
Mark all the (base) columns in this list as updatable by a positioned update statement. |
(package private) void |
markUpdatableByCursor(java.util.Vector updateColumns)
Mark as updatable all the columns in this result column list that match the columns in the given update column list |
(package private) void |
markUpdated()
Mark all the columns in this list as updated by an update statement. |
(package private) void |
markUpdated(ResultColumnList updateColumns)
Mark as updatable all the columns in this result column list that match the columns in the given update column list. |
void |
nameAllResultColumns()
Generate (unique across the entire statement) column names for those ResultColumns in this list which are not named. |
boolean |
nopProjection(ResultColumnList childRCL)
Determine whether this RCL is a No-Op projection of the given RCL. |
private int |
numGeneratedColumns()
|
(package private) int |
numGeneratedColumnsForGroupBy()
|
void |
populate(TableDescriptor table,
int[] columnIDs)
Build this ResultColumnList from a table description and an array of column IDs. |
void |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
Preprocess the expression trees under the RCL. |
void |
propagateDCLInfo(ResultColumnList derivedRCL,
java.lang.String tableName)
Validate the derived column list (DCL) and propagate the info from the list to the final ResultColumnList. |
(package private) void |
pullVirtualIsReferenced()
Or in any isReferenced booleans from the virtual column chain. |
void |
recordColumnReferences(boolean[] colArray1,
JBitSet[] tableColMap,
int tableNumber)
Record the top level ColumnReferences in the specified array and table map This is useful when checking for uniqueness conditions. |
void |
recordColumnReferences(int[] idArray,
int basis)
Record the column ids of the referenced columns in the specified array. |
(package private) void |
rejectParameters()
Look for and reject ? |
(package private) void |
rejectXMLValues()
Check for (and reject) XML values directly under the ResultColumns. |
void |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the underlying expression. |
(package private) void |
removeGeneratedGroupingColumns()
Remove any generated columns from this RCL. |
(package private) void |
removeJoinColumns(ResultColumnList joinColumns)
Remove the columns which are join columns (in the joinColumns RCL) from this list. |
void |
removeOrderByColumns()
Remove any columns that may have been added for an order by clause. |
(package private) void |
replaceOrForbidDefaults(TableDescriptor ttd,
ResultColumnList tcl,
boolean allowDefaults)
Replace any DEFAULTs with the associated tree for the default if allowed, or flag. |
(package private) void |
resetVirtualColumnIds()
Reset the virtual column ids for all of the underlying RCs. |
(package private) boolean |
reusableResult()
Return whether or not the same result row can be used for all rows returned by the associated ResultSet. |
protected void |
setCountMismatchAllowed(boolean 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. |
(package private) void |
setIndexRow(long cid,
boolean forUpdate)
|
void |
setNullability(boolean nullability)
Set the nullability of every ResultColumn in this list |
void |
setRedundant()
Mark all of the ResultColumns as redundant. |
void |
setResultSetNumber(int resultSetNumber)
Set the resultSetNumber in all of the ResultColumns. |
void |
setUnionResultExpression(ResultColumnList otherRCL,
int tableNumber,
int level,
java.lang.String 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. |
int[] |
sortMe()
Return an array of all my column positions, sorted in ascending order. |
private static boolean |
streamableType(ResultColumn rc)
|
java.lang.String |
toString()
Convert this object to a String. |
(package private) boolean |
updatableByCursor(int 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,
java.util.Map seenMap,
ResultColumn rc,
int index)
|
boolean |
updateOverlaps(int[] columns)
Does the column list contain any of the given column positions that are updated? |
(package private) void |
verifyAllOrderable()
Verify that all of the RCs in this list are comparable. |
java.lang.String |
verifyCreateConstraintColumnList(TableElementList tel)
Verify that all of the column names in this list are contained within the ColumnDefinitionNodes within the TableElementList. |
java.lang.String |
verifyUniqueNames(boolean errForGenCols)
Check the uniqueness of the column names within a column list. |
int |
visibleSize()
|
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNodeVector |
---|
acceptChildren, addElement, destructiveAppend, elementAt, indexOf, insertElementAt, nondestructiveAppend, printSubNodes, remove, removeAllElements, removeElement, removeElementAt, setElementAt, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean indexRow
protected long conglomerateId
int orderBySelect
protected boolean forUpdate
private boolean countMismatchAllowed
private int initialListSize
Constructor Detail |
---|
public ResultColumnList()
Method Detail |
---|
public void addResultColumn(ResultColumn resultColumn)
resultColumn
- The ResultColumn to add to the listpublic void appendResultColumns(ResultColumnList resultColumns, boolean destructiveCopy)
resultColumns
- The ResultColumnList to be appendeddestructiveCopy
- Whether or not this is a descructive copy
from resultColumnspublic ResultColumn getResultColumn(int position)
position
- The ResultColumn to get from the list (1-based)
public ResultColumn getResultColumn(int colNum, ResultSetNode rsn, int[] whichRC) throws StandardException
colNum
- The column position (w.r.t rsn) for which we're searchingrsn
- The result set node for which we're searching.
StandardException
public ResultColumn getOrderByColumn(int position)
position
- The ResultColumn to get from the list (1-based)
public ResultColumn getResultColumn(java.lang.String columnName)
columnName
- The ResultColumn to get from the list
public ResultColumn getResultColumn(java.lang.String columnName, boolean markIfReferenced)
columnName
- The ResultColumn to get from the listmarkIfReferenced
- True if we should mark this column as referenced.
public ResultColumn getResultColumn(int tableNumber, int columnNumber, java.lang.String columnName)
columnName
is used to assert that we find the right column.
If we found a match on (tn, cn) but columnName is wrong, return null.
Once we trust table numbers and column numbers to always be correct,
cf. DERBY-4695, we could remove this parameter.
tableNumber
- the table number to look forcolumnNumber
- the column number to look forcolumnName
- name of the desired columnpublic ResultColumn getResultColumn(java.lang.String columnsTableName, java.lang.String columnName)
columnsTableName
- Qualifying name for the columncolumnName
- The ResultColumn to get from the list
public ResultColumn getAtMostOneResultColumn(ColumnReference cr, java.lang.String exposedTableName, boolean considerGeneratedColumns) throws StandardException
cr
- The ColumnReference to resolveexposedTableName
- Exposed table name for FromTableconsiderGeneratedColumns
- 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.
StandardException
- Thrown on errorpublic ResultColumn getOrderByColumnToBind(java.lang.String columnName, TableName tableName, int tableNumber, OrderByColumn obc) throws StandardException
columnName
- The ResultColumn to get from the listtableName
- The table name on the OrderByColumn, if anytableNumber
- The tableNumber corresponding to the FromTable with the
exposed name of tableName, if tableName != null.obc
- The OrderByColumn we're binding.
StandardException
- thrown on ambiguityprivate void collapseVirtualColumnIdGap(int gap)
gap
- id of the column which was just removed.public ResultColumn findResultColumnForOrderBy(java.lang.String columnName, TableName tableName) throws StandardException
columnName
- The ResultColumn to get from the listtableName
- The table name on the OrderByColumn, if any
StandardException
- thrown on ambiguityvoid copyResultColumnNames(ResultColumnList nameList)
nameList
- The ResultColumnList from which to copy
the column namespublic void bindExpressions(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector) throws StandardException
fromList
- The FROM list for the query this
expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate vector being built as we find AggregateNodes
StandardException
- Thrown on errorpublic void bindResultColumnsToExpressions() throws StandardException
StandardException
- Thrown on errorpublic void bindResultColumnsByName(TableDescriptor targetTableDescriptor) throws StandardException
targetTableDescriptor
- The descriptor for the table
StandardException
- Thrown on errorpublic FormatableBitSet bindResultColumnsByName(TableDescriptor targetTableDescriptor, DMLStatementNode statement) throws StandardException
targetTableDescriptor
- The descriptor for the table being
updated or inserted intostatement
- DMLStatementNode containing this list, null if no duplicate checking is to be done
StandardException
- Thrown on errorpublic void bindResultColumnsByName(ResultColumnList fullRCL, FromVTI targetVTI, DMLStatementNode statement) throws StandardException
fullRCL
- The full RCL for the target tablestatement
- DMLStatementNode containing this list
StandardException
- Thrown on errorpublic void bindResultColumnsByPosition(TableDescriptor targetTableDescriptor) throws StandardException
targetTableDescriptor
- The descriptor for the table being
inserted into
StandardException
- Thrown on errorpublic void preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query block
StandardException
- Thrown on errorvoid checkStorableExpressions(ResultColumnList toStore) throws StandardException
StandardException
- Thrown on errorpublic int[] getStreamStorableColIds(int heapColCount) throws StandardException
heapColCount
- the number of heap columns
StandardException
- Thrown on errorvoid checkStorableExpressions() throws StandardException
StandardException
- Thrown on errorpublic void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the generated code to go into
StandardException
- Thrown on errorvoid generateNulls(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
- Thrown on errorvoid generateCore(ExpressionClassBuilder acb, MethodBuilder mb, boolean genNulls) throws StandardException
StandardException
public ExecRow buildEmptyRow() throws StandardException
StandardException
- Thrown on errorpublic ExecRow buildEmptyIndexRow(TableDescriptor td, ConglomerateDescriptor cd, StoreCostController scc, DataDictionary dd) throws StandardException
StandardException
- Thrown on errorvoid generateHolder(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
StandardException
void generateHolder(ExpressionClassBuilder acb, MethodBuilder mb, FormatableBitSet referencedCols, FormatableBitSet propagatedCols) throws StandardException
StandardException
MethodBuilder generateHolderMethod(ExpressionClassBuilder acb, FormatableBitSet referencedCols, FormatableBitSet propagatedCols) throws StandardException
StandardException
private void genCreateRow(ExpressionClassBuilder acb, LocalField field, java.lang.String rowAllocatorMethod, java.lang.String rowAllocatorType, int numCols) throws StandardException
acb
- The ACB.field
- The field for the new row.rowAllocatorMethod
- The method to call.rowAllocatorType
- The row type.numCols
- The number of columns in the row.
StandardException
- Thrown on errorpublic ResultColumnDescriptor[] makeResultDescriptors()
public void expandAllsAndNameColumns(FromList fromList) throws StandardException
StandardException
- Thrown on errorpublic void nameAllResultColumns() throws StandardException
StandardException
- Thrown on errorboolean columnTypesAndLengthsMatch() throws StandardException
StandardException
boolean columnTypesAndLengthsMatch(ResultColumnList otherRCL) throws StandardException
StandardException
public boolean nopProjection(ResultColumnList childRCL)
childRCL
- The ResultColumnList of the child result set.
public ResultColumnList copyListAndObjects() throws StandardException
StandardException
- Thrown on errorpublic void removeOrderByColumns()
select a from t order by bb is added to the select list However in the final projection, after the sort is complete, b will have to be removed.
public void genVirtualColumnNodes(ResultSetNode sourceResultSet, ResultColumnList sourceResultColumnList) throws StandardException
sourceResultSet
- ResultSetNode that is source of value
StandardException
- Thrown on errorpublic void genVirtualColumnNodes(ResultSetNode sourceResultSet, ResultColumnList sourceResultColumnList, boolean markReferenced) throws StandardException
sourceResultSet
- ResultSetNode that is source of valuemarkReferenced
- Whether or not to mark the underlying RCs
as referenced
StandardException
- Thrown on errorpublic void adjustVirtualColumnIds(int adjust)
adjust
- The size of the increment.public void doProjection() throws StandardException
StandardException
- Thrown on errorpublic java.lang.String verifyUniqueNames(boolean errForGenCols) throws StandardException
errForGenCols
- Raise an error for any generated column names.
StandardException
public void propagateDCLInfo(ResultColumnList derivedRCL, java.lang.String tableName) throws StandardException
derivedRCL
- The derived column listtableName
- The table name for the FromTable
StandardException
- Thrown on errorvoid rejectParameters() throws StandardException
StandardException
- Thrown if a ? parameter found directly
under a ResultColumnvoid rejectXMLValues() throws StandardException
StandardException
- Thrown if an XML value found
directly under a ResultColumnpublic void setResultSetNumber(int resultSetNumber)
resultSetNumber
- The resultSetNumberpublic void setRedundant()
public void checkColumnUpdateability(java.lang.String[] ucl, java.lang.String cursorName) throws StandardException
ucl
- The cursor's FOR UPDATE OF list. (May be null.)cursorName
- The cursor's name.
StandardException
- Thrown on errorpublic void setUnionResultExpression(ResultColumnList otherRCL, int tableNumber, int level, java.lang.String operatorName) throws StandardException
otherRCL
- RCL from other side of the UNION.tableNumber
- The tableNumber for the UNION.level
- The nesting level for the UNION.operatorName
- "UNION", "INTERSECT", or "EXCEPT"
StandardException
- Thrown on errorpublic boolean isExactTypeAndLengthMatch(ResultColumnList otherRCL) throws StandardException
otherRCL
- The other RCL.
StandardException
public boolean updateOverlaps(int[] columns)
columns
- An array of column positions
ResultColumn[] getSortedByPosition()
public int[] sortMe()
public ResultColumnList expandToAll(TableDescriptor td, TableName tableName) throws StandardException
td
- The TableDescriptor for the table in questiontableName
- The name of the table as given in the query
StandardException
- Thrown on errorpublic void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL) throws StandardException
bindingRCL
- The ResultColumnList with the types to bind to.
StandardException
- Thrown on errorvoid markUpdated()
void markUpdatableByCursor()
public void disablePrivilegeCollection()
QueryTreeNode
disablePrivilegeCollection
in class QueryTreeNode
QueryTreeNode.disablePrivilegeCollection()
public java.lang.String verifyCreateConstraintColumnList(TableElementList tel)
public void exportNames(java.lang.String[] columnNames)
columnNames
- String[] to hold the column names.public ResultColumn findParentResultColumn(ResultColumn childRC)
childRC
- The child ResultColumn
void markUpdated(ResultColumnList updateColumns)
updateColumns
- A ResultColumnList representing the columns
to be updated.void markColumnsInSelectListUpdatableByCursor(java.util.Vector updateColumns)
updateColumns
- A Vector representing the columns
to be updated.private void commonCodeForUpdatableByCursor(java.util.Vector updateColumns, boolean dealingWithSelectResultColumnList)
void markUpdatableByCursor(java.util.Vector updateColumns)
updateColumns
- A Vector representing the columns
to be updated.boolean updatableByCursor(int columnPosition)
columnPosition
- The position of the column in question
public boolean isCloneable()
public void remapColumnReferencesToExpressions() throws StandardException
StandardException
- Thrown on errorvoid setIndexRow(long cid, boolean forUpdate)
public boolean hasConsistentTypeInfo() throws StandardException
StandardException
public boolean containsAllResultColumn()
public int countReferencedColumns()
public void recordColumnReferences(int[] idArray, int basis)
idArray
- int[] for column idsbasis
- 0 (for 0-based ids) or 1 (for 1-based ids)public int getPosition(java.lang.String name, int basis)
name
- Name of the columnbasis
- 0 (for 0-based ids) or 1 (for 1-based ids)public void recordColumnReferences(boolean[] colArray1, JBitSet[] tableColMap, int tableNumber)
colArray1
- boolean[] for columnstableColMap
- JBitSet[] for tablestableNumber
- Table number of column referencesint allTopCRsFromSameTable()
public void clearColumnReferences()
public void copyReferencedColumnsToNewList(ResultColumnList targetList)
targetList
- The list to copy topublic void copyColumnsToNewList(ResultColumnList targetList, FormatableBitSet copyList)
targetList
- The list to copy to,copyList
- 1 based bitMap we copy columns associated with set bits.public FormatableBitSet getColumnReferenceMap()
void pullVirtualIsReferenced()
public void clearTableNames()
protected void setCountMismatchAllowed(boolean allowed)
allowed
- Whether or not a mismatch is allowed.protected boolean getCountMismatchAllowed()
public int getTotalColumnSize()
public void createListFromResultSetMetaData(java.sql.ResultSetMetaData rsmd, TableName tableName, java.lang.String javaClassName) throws StandardException
rsmd
- The ResultSetMetaData.tableName
- The TableName for the BCNs.javaClassName
- The name of the VTI
StandardException
- Thrown on errorpublic void addColumn(TableName tableName, java.lang.String columnName, DataTypeDescriptor dts) throws StandardException
StandardException
public void addRCForRID() throws StandardException
StandardException
- Thrown on errorpublic void markAllUnreferenced() throws StandardException
StandardException
- Thrown on errorboolean allExpressionsAreColumns(ResultSetNode sourceRS)
sourceRS
- The source ResultSet.
ResultColumnList.ColumnMapping mapSourceColumns()
public void setNullability(boolean nullability) throws StandardException
StandardException
FormatableBitSet getReferencedFormatableBitSet(boolean positionedUpdate, boolean always, boolean onlyBCNs)
positionedUpdate
- Whether or not the scan that the RCL
belongs to is for update w/o a column listalways
- Whether or not caller always wants a non-null FormatableBitSet if
all RCs are referenced.onlyBCNs
- If true, only set bit if expression is a BaseColumnNode,
otherwise set bit for all referenced RCs.
ResultColumnList compactColumns(boolean positionedUpdate, boolean always) throws StandardException
positionedUpdate
- Whether or not the scan that the RCL
belongs to is for update w/o a column listalways
- Whether or not caller always wants a new RCL
StandardException
- Thrown on errorvoid removeJoinColumns(ResultColumnList joinColumns)
joinColumns
- The list of join columnsResultColumnList getJoinColumns(ResultColumnList joinColumns) throws StandardException
joinColumns
- A list of the join columns.
StandardException
void resetVirtualColumnIds()
boolean reusableResult()
public int[] getColumnPositions(TableDescriptor td) throws StandardException
throws
- StandardException on error
StandardException
public java.lang.String[] getColumnNames()
void replaceOrForbidDefaults(TableDescriptor ttd, ResultColumnList tcl, boolean allowDefaults) throws StandardException
ttd
- The TableDescriptor for the target table.tcl
- The RCL for the target table.allowDefaults
- true if allowed
StandardException
- Thrown on errorvoid checkForInvalidDefaults() throws StandardException
StandardException
- Thrown on errorvoid verifyAllOrderable() throws StandardException
StandardException
- Thrown on errorpublic void populate(TableDescriptor table, int[] columnIDs) throws StandardException
table
- describes the tablecolumnIDs
- column positions in that table (1-based)
StandardException
- Thrown on errorprivate ResultColumn makeColumnFromName(java.lang.String columnName) throws StandardException
StandardException
private ResultColumn makeColumnReferenceFromName(TableName tableName, java.lang.String columnName) throws StandardException
StandardException
public void forbidOverrides(ResultColumnList sourceRSRCL) throws StandardException
StandardException
- If the column is an ai columnpublic void incOrderBySelect()
private void decOrderBySelect()
public int getOrderBySelect()
public void copyOrderBySelect(ResultColumnList src)
protected void markInitialSize()
private int numGeneratedColumns()
int numGeneratedColumnsForGroupBy()
void removeGeneratedGroupingColumns()
public int visibleSize()
public java.lang.String toString()
toString
in class QueryTreeNode
private static boolean streamableType(ResultColumn rc)
private static void updateArrays(int[] mapArray, boolean[] cloneMap, java.util.Map seenMap, ResultColumn rc, int index)
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |