Пример #1
0
  /** Emit non joined left/right full values. */
  @Override
  public void endWindow() {
    // left join
    if ((joinType == 0) || (joinType == 2)) {
      for (Map<String, Object> left : tuples1) {
        boolean merged = false;
        for (Map<String, Object> right : tuples2) {
          merged |= joinCondition.isValidJoin(left, right);
          if (merged) break;
        }
        if (!merged) {
          outport.emit(left);
        }
      }
    }

    // right join
    if ((joinType == 1) || (joinType == 2)) {
      for (Map<String, Object> right : tuples2) {
        boolean merged = false;
        for (Map<String, Object> left : tuples1) {
          merged |= joinCondition.isValidJoin(left, right);
          if (merged) break;
        }
        if (!merged) {
          outport.emit(right);
        }
      }
    }
  }
Пример #2
0
 @Override
 public void process(Map<String, Object> tuple) {
   if ((condition != null) && (!condition.isValidRow(tuple))) {
     return;
   }
   rows.add(tuple);
 }
Пример #3
0
 /**
  * Emit valid row join on output port.
  *
  * @param tuple1 Tuple from table1.
  * @param tuple2 Tuple form table2.
  */
 private void joinColumn(Map<String, Object> tuple1, Map<String, Object> tuple2) {
   if ((tuple1 == null) || (tuple2 == null)) return;
   boolean isValidJoin = true;
   if (joinCondition != null) {
     isValidJoin = joinCondition.isValidJoin(tuple1, tuple2);
   }
   if (isValidJoin) {
     Map<String, Object> join = new HashMap<String, Object>(tuple1);
     join.putAll(tuple2);
     outport.emit(join);
   }
 }