com.akiban.sql.parser
Class InsertNode

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.StatementNode
          extended by com.akiban.sql.parser.DMLStatementNode
              extended by com.akiban.sql.parser.DMLModStatementNode
                  extended by com.akiban.sql.parser.InsertNode
All Implemented Interfaces:
Visitable

public final class InsertNode
extends DMLModStatementNode

An InsertNode is the top node in a query tree for an insert statement.

After parsing, the node contains targetTableName: the target table for the insert collist: a list of column names, if specified queryexpr: the expression being inserted, either a values clause or a select form; both of these are represented via the SelectNode, potentially with a TableOperatorNode such as UnionNode above it.

After binding, the node has had the target table's descriptor located and inserted, and the queryexpr and collist have been massaged so that they are identical to the table layout. This involves adding any default values for missing columns, and reordering the columns to match the table's ordering of them.

After optimizing, ...


Field Summary
 
Fields inherited from class com.akiban.sql.parser.DMLModStatementNode
returningColumnList, targetTableName, targetVTI
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
InsertNode()
           
 
Method Summary
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 ValueNode getFetchFirst()
           
 ValueNode getOffset()
           
 OrderByList getOrderByList()
           
protected  int getStatementType()
          Return the type of statement, something from StatementType.
 ResultColumnList getTargetColumnList()
           
 Properties getTargetProperties()
           
 void init(Object targetName, Object insertColumns, Object queryExpression, Object targetProperties, Object orderByList, Object offset, Object fetchFirst, Object returningList)
          Initializer for an InsertNode.
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 String statementToString()
           
 
Methods inherited from class com.akiban.sql.parser.DMLModStatementNode
getReturningList, getTargetTableName, init, init, isAtomic, setReturningList
 
Methods inherited from class com.akiban.sql.parser.DMLStatementNode
getResultSetNode
 
Methods inherited from class com.akiban.sql.parser.StatementNode
toString
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, 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

InsertNode

public InsertNode()
Method Detail

init

public void init(Object targetName,
                 Object insertColumns,
                 Object queryExpression,
                 Object targetProperties,
                 Object orderByList,
                 Object offset,
                 Object fetchFirst,
                 Object returningList)
Initializer for an InsertNode.

Overrides:
init in class QueryTreeNode
Parameters:
targetName - The name of the table/VTI to insert into
insertColumns - A ResultColumnList with the names of the columns to insert into. May be null if the user did not specify the columns - in this case, the binding phase will have to figure it out.
queryExpression - The query expression that will generate the rows to insert into the given table
targetProperties - The properties specified on the target table
orderByList - The order by list for the source result set, null if no order by list

copyFrom

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

Overrides:
copyFrom in class DMLModStatementNode
Throws:
StandardException

statementToString

public String statementToString()
Specified by:
statementToString in class StatementNode

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 DMLModStatementNode
Parameters:
depth - The depth of this node in the tree

getStatementType

protected int getStatementType()
Return the type of statement, something from StatementType.

Overrides:
getStatementType in class QueryTreeNode
Returns:
the type of statement

getTargetColumnList

public ResultColumnList getTargetColumnList()

getTargetProperties

public Properties getTargetProperties()

getOrderByList

public OrderByList getOrderByList()

getOffset

public ValueNode getOffset()

getFetchFirst

public ValueNode getFetchFirst()


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