com.akiban.sql.parser
Class FromBaseTable

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.ResultSetNode
          extended by com.akiban.sql.parser.FromTable
              extended by com.akiban.sql.parser.FromBaseTable
All Implemented Interfaces:
Visitable

public class FromBaseTable
extends FromTable

A FromBaseTable represents a table in the FROM list of a DML statement, as distinguished from a FromSubquery, which represents a subquery in the FROM list. A FromBaseTable may actually represent a view. During parsing, we can't distinguish views from base tables. During binding, when we find FromBaseTables that represent views, we replace them with FromSubqueries. By the time we get to code generation, all FromSubqueries have been eliminated, and all FromBaseTables will represent only true base tables.

Positioned Update: Currently, all columns of an updatable cursor are selected to deal with a positioned update. This is because we don't know what columns will ultimately be needed from the UpdateNode above us. For example, consider:



 get c as 'select cint from t for update of ctinyint'
  update t set ctinyint = csmallint

 
Ideally, the cursor only selects cint. Then, something akin to an IndexRowToBaseRow is generated to take the CursorResultSet and get the appropriate columns out of the base table from the RowLocation retunrned by the cursor. Then the update node can generate the appropriate NormalizeResultSet (or whatever else it might need) to get things into the correct format for the UpdateResultSet. See CurrentOfNode for more information.


Nested Class Summary
static class FromBaseTable.UpdateOrDelete
           
 
Field Summary
 
Fields inherited from class com.akiban.sql.parser.FromTable
correlationName, origTableName, tableProperties
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
FromBaseTable()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 String getExposedName()
          Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query.
 TableName getExposedTableName()
          Get the exposed table name for this table, which is the name that can be used to refer to it in the rest of the query.
 IndexHintList getIndexHints()
           
 TableName getTableName()
          Return the table name for this table.
 void init(Object arg1, Object arg2, Object arg3)
          Initializer for a table in a DELETE/ UPDATE.
 void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
          Initializer for a table in a FROM list.
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 void setTableProperties(Properties tableProperties)
          Set the table properties for this table.
 String toString()
          Convert this object to a String.
 
Methods inherited from class com.akiban.sql.parser.FromTable
getCorrelationName, getOrigTableName, init, setCorrelationName, setOrigTableName
 
Methods inherited from class com.akiban.sql.parser.ResultSetNode
getResultColumns, setInsertSource, setResultColumns
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FromBaseTable

public FromBaseTable()
Method Detail

init

public void init(Object arg1,
                 Object arg2,
                 Object arg3,
                 Object arg4,
                 Object arg5)
Initializer for a table in a FROM list. Parameters are as follows:

Overrides:
init in class QueryTreeNode

init

public void init(Object arg1,
                 Object arg2,
                 Object arg3)
Initializer for a table in a DELETE/ UPDATE. Parameters are as follows:

Overrides:
init in class QueryTreeNode

copyFrom

public void copyFrom(QueryTreeNode node)
              throws StandardException
Fill this node with a deep copy of the given node.

Overrides:
copyFrom in class FromTable
Throws:
StandardException

toString

public String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class FromTable
Returns:
This object as a String

setTableProperties

public void setTableProperties(Properties tableProperties)
Set the table properties for this table.

Parameters:
tableProperties - The new table properties.

getExposedName

public String getExposedName()
Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query.

Overrides:
getExposedName in class FromTable
Returns:
The exposed name of this table.

getExposedTableName

public TableName getExposedTableName()
                              throws StandardException
Get the exposed table name for this table, which is the name that can be used to refer to it in the rest of the query.

Returns:
TableName The exposed name of this table.
Throws:
StandardException - Thrown on error

getTableName

public TableName getTableName()
                       throws StandardException
Return the table name for this table.

Overrides:
getTableName in class FromTable
Returns:
The table name for this table.
Throws:
StandardException - Thrown on error

getIndexHints

public IndexHintList getIndexHints()

printSubNodes

public void printSubNodes(int depth)
Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Overrides:
printSubNodes in class ResultSetNode
Parameters:
depth - The depth of this node in the tree


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.