|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor | +--edu.wpi.cs.dsrg.xmldb.xat.component.xattreegeneration.QueryDecorrelation
This class visits the XAT Tree constructed in ParserTraverse and get rid of For operaters. Thus we can get rid of inner loops in the XAT Tree and make a flat algebra tree.
To understand this code, one should know how the decorrelation works and what our algorithm is. It would also be helpful to know what a visitor pattern is because that is what we use to traverse through the query.
Currently, we need to 2 round of decorrelation to get rid of all For loops.
The Main issues in decorrelation is: 1. empty collection problem 2. count bugs.
Field Summary | |
protected OperatorBuilder |
builder
used to create operators |
protected java.lang.String[] |
contextForBindings
record the context FOR bindings for the groupby operator generation. |
protected XATNode |
currentParent
A global point to denote where is the current parent we are working with. |
protected XATTree |
decorrTree
record the decorrelated XAT Tree. |
Constructor Summary | |
protected |
QueryDecorrelation()
Class Default Constructor |
protected |
QueryDecorrelation(java.lang.String[] forContext,
XATTree tree)
Class Constructor with outer For binding context |
|
QueryDecorrelation(XATTree tree)
Class Constructor with XAT Tree to be decorrelated. |
Method Summary | |
java.lang.Object |
dispatch()
To visit a null object. |
java.lang.Object |
dispatch(java.lang.Object obj)
Called when an object hasn't been implemented by the visitor pattern default handling of the unknow operators. |
XATTree |
getDecorTree()
Access method of field decorrelate tree. |
boolean |
isDebug()
Get the value of the propertity 'DEBUG_QueryDecorrelation'. |
protected void |
moveLOJ(XATOperator xOp)
Find and move LOJ below specific node. |
java.lang.Object |
visit(Aggregate aggregate)
for the aggregate function there will be a groupby operator created with the FOR context, and then put the aggregate function as the subtree of it. |
java.lang.Object |
visit(Delete delNode)
Dummy function for delete operator |
java.lang.Object |
visit(Expose expNode)
Dummy function for expose operator |
java.lang.Object |
visit(FOR forOp)
When a FOR node is encountered, save its child as a temporary node. |
java.lang.Object |
visit(Function function)
Called when an aggregate function exists in the tree. |
java.lang.Object |
visit(GroupBy groupby)
for the groupby there will be a groupby operator created with the FOR context, and then put the original groupby as the subtree of it. |
java.lang.Object |
visit(Insert insNode)
Dummy function for insert operator |
java.lang.Object |
visit(Intersection intersect)
Dummy function for intersect operator |
java.lang.Object |
visit(NameColumn renNode)
Dummy function for Rename operator |
java.lang.Object |
visit(NavCollection navNode)
Dummy function for navigate collection operator |
java.lang.Object |
visit(NavUnnest navNode)
Dummy function for navigate unnest operator |
java.lang.Object |
visit(OrderBy orderBy)
Dummy function for orderby operator |
java.lang.Object |
visit(Replace repNode)
Dummy function for replace operator |
java.lang.Object |
visit(Select selectNode)
Dummy function for select operator |
java.lang.Object |
visit(Source sourceOp)
Inserts a source node into the newly decorrelated tree. |
java.lang.Object |
visit(Tagger taggerNode)
Dummy function for tagger operator |
java.lang.Object |
visit(Union union)
Dummy function for union operator |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor |
getAncestors,
getMethod,
visit,
visit |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String[] contextForBindings
protected XATTree decorrTree
protected XATNode currentParent
protected OperatorBuilder builder
Constructor Detail |
protected QueryDecorrelation()
protected QueryDecorrelation(java.lang.String[] forContext, XATTree tree)
public QueryDecorrelation(XATTree tree)
Method Detail |
public java.lang.Object dispatch()
public java.lang.Object dispatch(java.lang.Object obj)
public XATTree getDecorTree()
public boolean isDebug()
protected void moveLOJ(XATOperator xOp)
xOp
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATOperatorpublic java.lang.Object visit(Expose expNode)
expNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.specialoperator.ExposeImppublic java.lang.Object visit(FOR forOp)
forOp
- FOR operatorpublic java.lang.Object visit(Function function)
function
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.specialoperator.function.FunctionImppublic java.lang.Object visit(NameColumn renNode)
renNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.updateoperator.RenameImppublic java.lang.Object visit(Source sourceOp)
sourceNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.specialoperator.SourceImppublic java.lang.Object visit(GroupBy groupby)
groupby
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.sqloperator.GroupByImppublic java.lang.Object visit(Intersection intersect)
intersect
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.sqloperator.IntersectImppublic java.lang.Object visit(OrderBy orderBy)
orderBy
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.sqloperator.OrderByImppublic java.lang.Object visit(Select selectNode)
selectNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.sqloperator.SelectImppublic java.lang.Object visit(Union union)
union
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.sqloperator.UnionImppublic java.lang.Object visit(Delete delNode)
delNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.updateoperator.DeleteImppublic java.lang.Object visit(Insert insNode)
insNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.updateoperator.InsertImppublic java.lang.Object visit(Replace repNode)
repNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.updateoperator.ReplaceImppublic java.lang.Object visit(Aggregate aggregate)
aggregate
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.xmloperator.AggregateImppublic java.lang.Object visit(NavCollection navNode)
navNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.xmloperator.NavCollectionImppublic java.lang.Object visit(NavUnnest navNode)
navNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.xmloperator.NavUnnestImppublic java.lang.Object visit(Tagger taggerNode)
taggerNode
- edu.wpi.cs.dsrg.xmldb.xat.common.operator.xmloperator.TaggerImp
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |