Exemplo n.º 1
0
 public JoinCondDesc(org.apache.hadoop.hive.ql.parse.JoinCond condn) {
   left = condn.getLeft();
   right = condn.getRight();
   preserved = condn.getPreserved();
   switch (condn.getJoinType()) {
     case INNER:
       type = JoinDesc.INNER_JOIN;
       break;
     case LEFTOUTER:
       type = JoinDesc.LEFT_OUTER_JOIN;
       break;
     case RIGHTOUTER:
       type = JoinDesc.RIGHT_OUTER_JOIN;
       break;
     case FULLOUTER:
       type = JoinDesc.FULL_OUTER_JOIN;
       break;
     case UNIQUE:
       type = JoinDesc.UNIQUE_JOIN;
       break;
     case LEFTSEMI:
       type = JoinDesc.LEFT_SEMI_JOIN;
       break;
     default:
       assert false;
   }
 }
Exemplo n.º 2
0
 void printJoinTree(QBJoinTree joinTree, StringBuilder builder) {
   builder.append("leftAlias:" + joinTree.getLeftAlias());
   if (joinTree.getLeftAliases() != null) {
     builder.append("\n leftAliases:");
     for (String alias : joinTree.getLeftAliases()) {
       builder.append("\n\t " + alias);
     }
   }
   if (joinTree.getRightAliases() != null) {
     builder.append("\n rightAliases:");
     for (String alias : joinTree.getRightAliases()) {
       builder.append("\n\t " + alias);
     }
   }
   if (joinTree.getJoinSrc() != null) {
     builder.append("\n JoinSrc: {");
     printJoinTree(joinTree.getJoinSrc(), builder);
     builder.append("\n }");
   }
   if (joinTree.getBaseSrc() != null) {
     builder.append("\n baseSrcs:");
     for (String src : joinTree.getBaseSrc()) {
       builder.append("\n\t " + src);
     }
   }
   builder.append("\n noOuterJoin: " + joinTree.getNoOuterJoin());
   builder.append("\n noSemiJoin: " + joinTree.getNoSemiJoin());
   builder.append("\n mapSideJoin: " + joinTree.isMapSideJoin());
   if (joinTree.getJoinCond() != null) {
     builder.append("\n joinConds:");
     for (JoinCond cond : joinTree.getJoinCond()) {
       builder.append(
           "\n\t left: "
               + cond.getLeft()
               + " right: "
               + cond.getRight()
               + " type:"
               + cond.getJoinType()
               + " preserved:"
               + cond.getPreserved());
     }
   }
 }