|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.akiban.sql.compiler.TypeComputer
public class TypeComputer
Calculate types from schema information.
| Constructor Summary | |
|---|---|
TypeComputer()
|
|
| Method Summary | |
|---|---|
protected boolean |
addDominantCast(DataTypeDescriptor toType,
DataTypeDescriptor fromType)
|
protected DataTypeDescriptor |
aggregateNode(AggregateNode node)
|
protected DataTypeDescriptor |
betweenOperatorNode(BetweenOperatorNode node)
|
protected DataTypeDescriptor |
binaryArithmeticOperatorNode(BinaryArithmeticOperatorNode node)
|
protected DataTypeDescriptor |
binaryComparisonOperatorNode(BinaryComparisonOperatorNode node)
|
protected DataTypeDescriptor |
binaryLogicalOperatorNode(BinaryLogicalOperatorNode node)
|
protected DataTypeDescriptor |
coalesceFunctionNode(CoalesceFunctionNode node)
|
protected ValueNode |
collateNode(ExplicitCollateNode node)
|
void |
compute(StatementNode stmt)
|
protected DataTypeDescriptor |
computeType(ValueNode node)
Probably need to subclass and handle NodeTypes.COLUMN_REFERENCE
to get type propagation started. |
protected DataTypeDescriptor |
concatenationOperatorNode(ConcatenationOperatorNode node)
|
protected DataTypeDescriptor |
conditionalNode(ConditionalNode node)
|
protected DataTypeDescriptor |
dominantType(ValueNodeList nodeList)
|
protected void |
fromSubquery(FromSubquery node)
|
protected TypeCompiler |
getTypeCompiler(TypeId typeId)
Get the TypeCompiler associated with the given TypeId |
protected TypeCompiler |
getTypeCompiler(ValueNode valueNode)
Get the TypeCompiler from this ValueNode, based on its TypeId using getTypeId(). |
protected DataTypeDescriptor |
inListOperatorNode(InListOperatorNode node)
|
protected void |
insertNode(InsertNode node)
|
protected boolean |
isNestedTupleNullable(RowConstructorNode row)
|
protected static boolean |
isParameterOrUntypedNull(ValueNode node)
Nodes whose type is inferred from the context. |
protected DataTypeDescriptor |
resultColumn(ResultColumn node)
|
protected void |
selectNode(SelectNode node)
|
protected ValueNode |
setType(ValueNode node)
|
boolean |
skipChildren(Visitable node)
Method that is called to indicate whether we should skip all nodes below this node for traversal. |
boolean |
stopTraversal()
Method that is called to see if query tree traversal should be stopped before visiting all nodes. |
protected DataTypeDescriptor |
subqueryNode(SubqueryNode node)
|
protected DataTypeDescriptor |
unaryLogicalOperatorNode(UnaryLogicalOperatorNode node)
|
Visitable |
visit(Visitable node)
This is the default visit operation on a QueryTreeNode. |
boolean |
visitChildrenFirst(Visitable node)
Method that is called to see if visit() should be called on
the children of node before it is called on node itself. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeComputer()
| Method Detail |
|---|
public void compute(StatementNode stmt)
throws StandardException
StandardException
protected ValueNode setType(ValueNode node)
throws StandardException
StandardException
protected DataTypeDescriptor computeType(ValueNode node)
throws StandardException
NodeTypes.COLUMN_REFERENCE
to get type propagation started.
StandardExceptionprotected static boolean isParameterOrUntypedNull(ValueNode node)
protected DataTypeDescriptor resultColumn(ResultColumn node)
throws StandardException
StandardException
protected DataTypeDescriptor unaryLogicalOperatorNode(UnaryLogicalOperatorNode node)
throws StandardException
StandardException
protected DataTypeDescriptor binaryLogicalOperatorNode(BinaryLogicalOperatorNode node)
throws StandardException
StandardException
protected DataTypeDescriptor binaryArithmeticOperatorNode(BinaryArithmeticOperatorNode node)
throws StandardException
StandardException
protected DataTypeDescriptor binaryComparisonOperatorNode(BinaryComparisonOperatorNode node)
throws StandardException
StandardException
protected DataTypeDescriptor betweenOperatorNode(BetweenOperatorNode node)
throws StandardException
StandardException
protected DataTypeDescriptor inListOperatorNode(InListOperatorNode node)
throws StandardException
StandardExceptionprotected boolean isNestedTupleNullable(RowConstructorNode row)
protected DataTypeDescriptor subqueryNode(SubqueryNode node)
throws StandardException
StandardException
protected DataTypeDescriptor conditionalNode(ConditionalNode node)
throws StandardException
StandardException
protected DataTypeDescriptor coalesceFunctionNode(CoalesceFunctionNode node)
throws StandardException
StandardException
protected DataTypeDescriptor aggregateNode(AggregateNode node)
throws StandardException
StandardException
protected DataTypeDescriptor concatenationOperatorNode(ConcatenationOperatorNode node)
throws StandardException
StandardException
protected ValueNode collateNode(ExplicitCollateNode node)
throws StandardException
StandardException
protected DataTypeDescriptor dominantType(ValueNodeList nodeList)
throws StandardException
StandardException
protected boolean addDominantCast(DataTypeDescriptor toType,
DataTypeDescriptor fromType)
protected void selectNode(SelectNode node)
throws StandardException
StandardException
protected void fromSubquery(FromSubquery node)
throws StandardException
StandardException
protected void insertNode(InsertNode node)
throws StandardException
StandardException
public Visitable visit(Visitable node)
throws StandardException
VisitorVisitors will overload this method by implementing a version with a signature that matches a specific type of node. For example, if I want to do something special with aggregate nodes, then that Visitor will implement a visit(AggregateNode node) method which does the aggregate specific processing.
visit in interface Visitornode - the node to process
StandardException - may be throw an error
as needed by the visitor (i.e. may be a normal error
if a particular node is found, e.g. if checking
a group by, we don't expect to find any ColumnReferences
that aren't under an AggregateNode -- the easiest
thing to do is just throw an error when we find the
questionable node).
public boolean skipChildren(Visitable node)
throws StandardException
VisitorDiffers from stopTraversal() in that it only affects subtrees, rather than the entire traversal.
skipChildren in interface Visitornode - the node to process
StandardExceptionpublic boolean visitChildrenFirst(Visitable node)
Visitorvisit() should be called on
the children of node before it is called on node itself.
If this method always returns true, the visitor will walk the
tree bottom-up. If it always returns false, the tree is visited
top-down.
visitChildrenFirst in interface Visitornode - the top node of a sub-tree about to be visited
true if node's children should be visited
before node, false otherwisepublic boolean stopTraversal()
Visitor
stopTraversal in interface Visitorprotected TypeCompiler getTypeCompiler(TypeId typeId)
typeId - The TypeId to get a TypeCompiler for
protected TypeCompiler getTypeCompiler(ValueNode valueNode)
throws StandardException
StandardException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||