| Constructor and Description |
|---|
TypeComputer() |
| Modifier and Type | Method and Description |
|---|---|
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)
Method called for each node that is visited.
|
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. |
public void compute(StatementNode stmt) throws StandardException
StandardExceptionprotected ValueNode setType(ValueNode node) throws StandardException
StandardExceptionprotected 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
StandardExceptionprotected DataTypeDescriptor unaryLogicalOperatorNode(UnaryLogicalOperatorNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor binaryLogicalOperatorNode(BinaryLogicalOperatorNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor binaryArithmeticOperatorNode(BinaryArithmeticOperatorNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor binaryComparisonOperatorNode(BinaryComparisonOperatorNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor betweenOperatorNode(BetweenOperatorNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor inListOperatorNode(InListOperatorNode node) throws StandardException
StandardExceptionprotected boolean isNestedTupleNullable(RowConstructorNode row)
protected DataTypeDescriptor subqueryNode(SubqueryNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor conditionalNode(ConditionalNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor coalesceFunctionNode(CoalesceFunctionNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor aggregateNode(AggregateNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor concatenationOperatorNode(ConcatenationOperatorNode node) throws StandardException
StandardExceptionprotected ValueNode collateNode(ExplicitCollateNode node) throws StandardException
StandardExceptionprotected DataTypeDescriptor dominantType(ValueNodeList nodeList) throws StandardException
StandardExceptionprotected boolean addDominantCast(DataTypeDescriptor toType, DataTypeDescriptor fromType)
protected void selectNode(SelectNode node) throws StandardException
StandardExceptionprotected void fromSubquery(FromSubquery node) throws StandardException
StandardExceptionprotected void insertNode(InsertNode node) throws StandardException
StandardExceptionpublic Visitable visit(Visitable node) throws StandardException
Visitorvisit in interface Visitornode - the node to processStandardException - 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 processStandardExceptionpublic 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 visitedtrue if node's children should be visited
before node, false otherwisepublic boolean stopTraversal()
VisitorstopTraversal in interface Visitorprotected TypeCompiler getTypeCompiler(TypeId typeId)
typeId - The TypeId to get a TypeCompiler forprotected TypeCompiler getTypeCompiler(ValueNode valueNode) throws StandardException
StandardExceptionCopyright © 2015 FoundationDB, LLC. All rights reserved.