com.akiban.sql.parser
Class SelectNode

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

public class SelectNode
extends ResultSetNode

A SelectNode represents the result set for any of the basic DML operations: SELECT, INSERT, UPDATE, and DELETE. (A RowResultSetNode will be used for an INSERT with a VALUES clause.) For INSERT - SELECT, any of the fields in a SelectNode can be used (the SelectNode represents the SELECT statement in the INSERT - SELECT). For UPDATE and DELETE, there will be one table in the fromList, and the groupByList fields will be null. For both INSERT and UPDATE, the resultColumns in the selectList will contain the names of the columns being inserted into or updated.


Field Summary
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
SelectNode()
           
 
Method Summary
 void clearDistinct()
           
 void copyFrom(QueryTreeNode node)
          Fill this node with a deep copy of the given node.
 FromList getFromList()
          Return the fromList for this SelectNode.
 GroupByList getGroupByList()
           
 ValueNode getHavingClause()
           
 ValueNode getWhereClause()
          Return the whereClause for this SelectNode.
 WindowList getWindows()
           
 boolean hasWindows()
          Used by SubqueryNode to avoid flattening of a subquery if a window is defined on it.
 void init(Object selectList, Object aggregateList, Object fromList, Object whereClause, Object groupByList, Object havingClause, Object windowDefinitionList)
          Initialize a query tree node.
 boolean isDistinct()
           
 boolean isStraightJoin()
           
 void makeDistinct()
           
 void makeStraightJoin()
           
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 void setHavingClause(ValueNode havingClause)
           
 void setWhereClause(ValueNode whereClause)
           
 String statementToString()
           
 String toString()
          Convert this object to a String.
 
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, 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

SelectNode

public SelectNode()
Method Detail

init

public void init(Object selectList,
                 Object aggregateList,
                 Object fromList,
                 Object whereClause,
                 Object groupByList,
                 Object havingClause,
                 Object windowDefinitionList)
          throws StandardException
Description copied from class: QueryTreeNode
Initialize a query tree node.

Overrides:
init in class QueryTreeNode
Throws:
StandardException - Thrown on error

copyFrom

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

Overrides:
copyFrom in class ResultSetNode
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 ResultSetNode
Returns:
This object as a String

statementToString

public String statementToString()

makeDistinct

public void makeDistinct()

clearDistinct

public void clearDistinct()

isDistinct

public boolean isDistinct()

makeStraightJoin

public void makeStraightJoin()

isStraightJoin

public boolean isStraightJoin()

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

getFromList

public FromList getFromList()
Return the fromList for this SelectNode.

Returns:
FromList The fromList for this SelectNode.

getWhereClause

public ValueNode getWhereClause()
Return the whereClause for this SelectNode.

Returns:
ValueNode The whereClause for this SelectNode.

setWhereClause

public void setWhereClause(ValueNode whereClause)

getGroupByList

public GroupByList getGroupByList()

getHavingClause

public ValueNode getHavingClause()

setHavingClause

public void setHavingClause(ValueNode havingClause)

hasWindows

public boolean hasWindows()
Used by SubqueryNode to avoid flattening of a subquery if a window is defined on it. Note that any inline window definitions should have been collected from both the selectList and orderByList at the time this method is called, so the windows list is complete. This is true after preprocess is completed.

Returns:
true if this select node has any windows on it

getWindows

public WindowList getWindows()


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