Github user sirpkt commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/379#discussion_r24468860
  
    --- Diff: 
tajo-plan/src/main/java/org/apache/tajo/plan/joinorder/GreedyHeuristicJoinOrderAlgorithm.java
 ---
    @@ -57,17 +54,69 @@ public FoundJoinOrder findBestOrder(LogicalPlan plan, 
LogicalPlan.QueryBlock blo
         JoinEdge bestPair;
     
         while (remainRelations.size() > 1) {
    +      Set<LogicalNode> checkingRelations = new 
LinkedHashSet<LogicalNode>();
    +
    +      for (LogicalNode relation : remainRelations) {
    +        Collection <String> relationStrings = 
PlannerUtil.getRelationLineageWithinQueryBlock(plan, relation);
    +        List<JoinEdge> joinEdges = new ArrayList<JoinEdge>();
    +        String relationCollection = 
TUtil.collectionToString(relationStrings, ",");
    +        List<JoinEdge> joinEdgesForGiven = 
joinGraph.getIncomingEdges(relationCollection);
    +        if (joinEdgesForGiven != null) {
    +          joinEdges.addAll(joinEdgesForGiven);
    +        }
    +        for (String relationString: relationStrings) {
    +          joinEdgesForGiven = joinGraph.getIncomingEdges(relationString);
    +          if (joinEdgesForGiven != null) {
    +            joinEdges.addAll(joinEdgesForGiven);
    +          }
    +        }
    +
    +        // check if the relation is the last piece of outer join
    +        boolean endInnerRelation = false;
    +        for (JoinEdge joinEdge: joinEdges) {
    +          switch(joinEdge.getJoinType()) {
    +            case LEFT_OUTER:
    +            case RIGHT_OUTER:
    +            case FULL_OUTER:
    --- End diff --
    
    Thank you for the comment, @jihoonson .
    I'll add other join types.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to