Program: 33622
Project: 33622
Buggy source:
/** 
 * Joins the given   {@link JavaRDD} to the one specified in the {@link UnionStep} if it's ready; otherwise, the{@link JavaRDD} is stored to wait for the other {@link JavaRDD} to be ready.
 * @param unionStep Union information.
 * @param rdd Original  {@link JavaRDD} to be joined.
 * @return The resultant {@link JavaRDD} after executing the join method. It might be the original one if the other{@link JavaRDD} is not ready yet.
 * @throws ExecutionException If the execution of the required steps fails.
 * @throws UnsupportedException If the required set of operations are not supported by the connector.
 */
private JavaRDD<Cells> executeUnion(UnionStep unionStep,JavaRDD<Cells> rdd) throws ExecutionException, UnsupportedException {
  JavaRDD<Cells> joinedRdd=null;
  if (unionStep instanceof Join) {
    Join joinStep=(Join)unionStep;
    if (joinStep.getOperation().equals(Operations.SELECT_INNER_JOIN_PARTIALS_RESULTS)) {
      PartialResults partialResults=QueryPartialResultsUtils.getPartialResult(joinStep);
      JavaRDD<Cells> partialResultsRdd=QueryPartialResultsUtils.createRDDFromResultSet(deepContext,partialResults.getResults());
      List<Relation> relations=QueryPartialResultsUtils.getOrderedRelations(partialResults,joinStep.getJoinRelations());
      joinedRdd=executeJoin(partialResultsRdd,rdd,relations);
    }
 else {
      String joinLeftTableName=joinStep.getSourceIdentifiers().get(0);
      JavaRDD<Cells> leftRdd=partialResultsMap.get(joinLeftTableName);
      if (leftRdd != null) {
        joinedRdd=executeJoin(leftRdd,rdd,joinStep.getJoinRelations());
        partialResultsMap.remove(joinLeftTableName);
      }
    }
  }
 else {
    throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
  }
  return joinedRdd;
}

Fixed version (ground truth):
/** 
 * Joins the given   {@link JavaRDD} to the one specified in the {@link UnionStep} if it's ready; otherwise, the{@link JavaRDD} is stored to wait for the other {@link JavaRDD} to be ready.
 * @param unionStep Union information.
 * @param rdd Original  {@link JavaRDD} to be joined.
 * @return The resultant {@link JavaRDD} after executing the join method. It might be the original one if the other{@link JavaRDD} is not ready yet.
 * @throws ExecutionException If the execution of the required steps fails.
 * @throws UnsupportedException If the required set of operations are not supported by the connector.
 */
private JavaRDD<Cells> executeUnion(UnionStep unionStep,JavaRDD<Cells> rdd) throws ExecutionException, UnsupportedException {
  JavaRDD<Cells> joinedRdd=null;
  if (unionStep instanceof Join) {
    Join joinStep=(Join)unionStep;
    if (joinStep.getOperation().equals(Operations.SELECT_INNER_JOIN_PARTIALS_RESULTS)) {
      PartialResults partialResults=QueryPartialResultsUtils.getPartialResult(joinStep);
      JavaRDD<Cells> partialResultsRdd=QueryPartialResultsUtils.createRDDFromResultSet(deepContext,partialResults.getResults());
      List<Relation> relations=QueryPartialResultsUtils.getOrderedRelations(partialResults,joinStep.getJoinRelations());
      joinedRdd=executeJoin(partialResultsRdd,rdd,relations,false);
    }
 else {
      String joinLeftTableName=joinStep.getSourceIdentifiers().get(0);
      JavaRDD<Cells> partialRdd=partialResultsMap.get(joinLeftTableName);
      boolean reversed=false;
      if (partialRdd != null) {
        partialResultsMap.remove(joinLeftTableName);
      }
 else {
        reversed=true;
        String joinRightTableName=joinStep.getSourceIdentifiers().get(1);
        partialRdd=partialResultsMap.get(joinRightTableName);
        partialResultsMap.remove(joinRightTableName);
      }
      if (partialRdd != null) {
        joinedRdd=executeJoin(rdd,partialRdd,joinStep.getJoinRelations(),reversed);
      }
    }
  }
 else {
    throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
  }
  return joinedRdd;
}