nus-yam/ex-repair huggingface dataset:
Program: 33620
Project: 33620
Buggy source:
@Test public void doJoinTest(){
  List<Relation> relations=new ArrayList<Relation>();
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE2_CONSTANT.getName(),COLUMN2_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  relations.add(relation);
  JavaRDD<Cells> outputrdd=QueryFilterUtils.doJoin(leftRdd,rightRdd,relations);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + outputrdd.count());
    logger.debug("String_Node_Str" + outputrdd.first().toString());
    int i=0;
    for (    Cells cell : outputrdd.collect()) {
      logger.debug("String_Node_Str" + (i++) + "String_Node_Str"+ cell.getCellValues());
    }
  }
  verify(leftRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rightRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rddLeft,times(0)).join(rddRight);
  verify(joinRDD,times(0)).map(any(JoinCells.class));
}

Fixed version (ground truth):
@Test public void doJoinTest(){
  List<Relation> relations=new ArrayList<Relation>();
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE2_CONSTANT.getName(),COLUMN2_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  relations.add(relation);
  JavaRDD<Cells> outputrdd=QueryFilterUtils.doJoin(leftRdd,rightRdd,relations,false);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + outputrdd.count());
    logger.debug("String_Node_Str" + outputrdd.first().toString());
    int i=0;
    for (    Cells cell : outputrdd.collect()) {
      logger.debug("String_Node_Str" + (i++) + "String_Node_Str"+ cell.getCellValues());
    }
  }
  verify(leftRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rightRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rddLeft,times(0)).join(rddRight);
  verify(joinRDD,times(0)).map(any(JoinCells.class));
}
Program: 33621
Project: 33621
Buggy source:
/** 
 * Joins the left   {@link JavaRDD} to the right one based on the given list of relations.
 * @param leftRdd Left  {@link JavaRDD}.
 * @param rdd right  {@link JavaRDD}.
 * @param joinRelations List of relations to take into account when joining.
 * @return Joined {@link JavaRDD}.
 */
private JavaRDD<Cells> executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations){
  return QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations);
}

Fixed version (ground truth):
/** 
 * Joins the left   {@link JavaRDD} to the right one based on the given list of relations.
 * @param leftRdd Left  {@link JavaRDD}.
 * @param rdd right  {@link JavaRDD}.
 * @param joinRelations List of relations to take into account when joining.
 * @return Joined {@link JavaRDD}.
 */
private JavaRDD<Cells> executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations,boolean reversed){
  return QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations,reversed);
}
Program: 33623
Project: 33623
Buggy source:
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations){
  JavaRDD<Cells> joinedResult=null;
  List<ColumnName> leftTables=new ArrayList<>();
  List<ColumnName> rightTables=new ArrayList<>();
  for (  Relation relation : joinRelations) {
    ColumnSelector selectorRight=(ColumnSelector)relation.getRightTerm();
    ColumnSelector selectorLeft=(ColumnSelector)relation.getLeftTerm();
    if (relation.getOperator().equals(Operator.EQ)) {
      leftTables.add(selectorLeft.getName());
      rightTables.add(selectorRight.getName());
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
      }
    }
  }
  JavaPairRDD<List<Object>,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin(leftTables));
  JavaPairRDD<List<Object>,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin(rightTables));
  if (rddLeft != null && rddRight != null) {
    JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
    joinedResult=joinRDD.map(new JoinCells());
  }
  return joinedResult;
}

Fixed version (ground truth):
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations,boolean reversed){
  JavaRDD<Cells> joinedResult=null;
  List<ColumnName> firstTables=new ArrayList<>();
  List<ColumnName> secondTables=new ArrayList<>();
  for (  Relation relation : joinRelations) {
    ColumnSelector selectorRight=(ColumnSelector)relation.getRightTerm();
    ColumnSelector selectorLeft=(ColumnSelector)relation.getLeftTerm();
    if (relation.getOperator().equals(Operator.EQ)) {
      firstTables.add(selectorLeft.getName());
      secondTables.add(selectorRight.getName());
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
      }
    }
  }
  JavaPairRDD<List<Object>,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin(reversed ? secondTables : firstTables));
  JavaPairRDD<List<Object>,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin(reversed ? firstTables : secondTables));
  if (rddLeft != null && rddRight != null) {
    JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
    joinedResult=joinRDD.map(new JoinCells());
  }
  return joinedResult;
}
Program: 33624
Project: 33624
Buggy source:
@Test public void doJoinTest(){
  List<Relation> relations=new ArrayList<Relation>();
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE2_CONSTANT.getName(),COLUMN2_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  relations.add(relation);
  JavaRDD<Cells> outputrdd=QueryFilterUtils.doJoin(leftRdd,rightRdd,relations);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + outputrdd.count());
    logger.debug("String_Node_Str" + outputrdd.first().toString());
    int i=0;
    for (    Cells cell : outputrdd.collect()) {
      logger.debug("String_Node_Str" + (i++) + "String_Node_Str"+ cell.getCellValues());
    }
  }
  verify(leftRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rightRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rddLeft,times(0)).join(rddRight);
  verify(joinRDD,times(0)).map(any(JoinCells.class));
}

Fixed version (ground truth):
@Test public void doJoinTest(){
  List<Relation> relations=new ArrayList<Relation>();
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE2_CONSTANT.getName(),COLUMN2_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  relations.add(relation);
  JavaRDD<Cells> outputrdd=QueryFilterUtils.doJoin(leftRdd,rightRdd,relations,false);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + outputrdd.count());
    logger.debug("String_Node_Str" + outputrdd.first().toString());
    int i=0;
    for (    Cells cell : outputrdd.collect()) {
      logger.debug("String_Node_Str" + (i++) + "String_Node_Str"+ cell.getCellValues());
    }
  }
  verify(leftRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rightRdd,times(1)).mapToPair(any(MapKeyForJoin.class));
  verify(rddLeft,times(0)).join(rddRight);
  verify(joinRDD,times(0)).map(any(JoinCells.class));
}
Program: 33626
Project: 33626
Buggy source:
/** 
 * Use config & Credentials to create Deep native connection.
 * @param iCredentials .
 * @param connectorClusterConfig .
 * @return DeepConnection.
 */
@Override protected Connection createNativeConnection(ICredentials iCredentials,ConnectorClusterConfig connectorClusterConfig) throws CreateNativeConnectionException {
  Connection connection;
  connection=new DeepConnection(iCredentials,connectorClusterConfig);
  return connection;
}

Fixed version (ground truth):
/** 
 * Use config & Credentials to create Deep native connection.
 * @param iCredentials .
 * @param connectorClusterConfig .
 * @return DeepConnection.
 */
@Override protected Connection createNativeConnection(ICredentials iCredentials,ConnectorClusterConfig connectorClusterConfig) throws CreateNativeConnectionException {
  Connection connection;
  try {
    connection=new DeepConnection(iCredentials,connectorClusterConfig);
  }
 catch (  ConnectionException e) {
    throw new CreateNativeConnectionException("String_Node_Str",e);
  }
  return connection;
}
Program: 33627
Project: 33627
Buggy source:
@Override public Cells call(Tuple2<List<Object>,Cells> v1) throws Exception {
  return v1._2;
}

Fixed version (ground truth):
@Override public Cells call(Tuple2<List<Cell>,Cells> tuple) throws Exception {
  return tuple._2;
}
Program: 33628
Project: 33628
Buggy source:
/** 
 * Function that returns a grouped   {@link JavaRDD} by a list of fields from an initial {@link JavaRDD}.
 * @param rdd Initial  {@link JavaRDD}.
 * @param ids List of fields to group by.
 * @return Grouped {@link JavaRDD}.
 */
public static JavaRDD<Cells> groupByFields(JavaRDD<Cells> rdd,List<Selector> ids){
  JavaPairRDD<List<Object>,Cells> rddWithKeys=rdd.keyBy(new Function<Cells,List<Object>>(){
    private static final long serialVersionUID=8157822963856298774L;
    @Override public List<Object> call(    Cells v1) throws Exception {
      return null;
    }
  }
);
  JavaPairRDD<List<Object>,Cells> reducedRdd=rddWithKeys.reduceByKey(new Function2<Cells,Cells,Cells>(){
    private static final long serialVersionUID=-2505406515481546086L;
    @Override public Cells call(    Cells v1,    Cells v2) throws Exception {
      return v1;
    }
  }
);
  return reducedRdd.map(new Function<Tuple2<List<Object>,Cells>,Cells>(){
    private static final long serialVersionUID=-4921967044782514288L;
    @Override public Cells call(    Tuple2<List<Object>,Cells> v1) throws Exception {
      return v1._2;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Function that returns a grouped   {@link JavaRDD} by a list of fields from an initial {@link JavaRDD}.
 * @param rdd Initial  {@link JavaRDD}.
 * @param ids List of fields to group by.
 * @return Grouped {@link JavaRDD}.
 */
public static JavaRDD<Cells> groupByFields(JavaRDD<Cells> rdd,final List<Selector> selectors){
  JavaPairRDD<List<Cell>,Cells> rddWithKeys=rdd.keyBy(new Function<Cells,List<Cell>>(){
    private static final long serialVersionUID=8157822963856298774L;
    @Override public List<Cell> call(    Cells cells) throws Exception {
      List<Cell> keysList=new ArrayList<>();
      for (      Selector selector : selectors) {
        ColumnSelector columnSelector=(ColumnSelector)selector;
        Cell cell=cells.getCellByName(columnSelector.getName().getTableName().getQualifiedName(),columnSelector.getName().getName());
        keysList.add(cell);
      }
      return keysList;
    }
  }
);
  JavaPairRDD<List<Cell>,Cells> reducedRdd=rddWithKeys.reduceByKey(new Function2<Cells,Cells,Cells>(){
    private static final long serialVersionUID=-2505406515481546086L;
    @Override public Cells call(    Cells leftCells,    Cells rightCells) throws Exception {
      return leftCells;
    }
  }
);
  return reducedRdd.map(new Function<Tuple2<List<Cell>,Cells>,Cells>(){
    private static final long serialVersionUID=-4921967044782514288L;
    @Override public Cells call(    Tuple2<List<Cell>,Cells> tuple) throws Exception {
      return tuple._2;
    }
  }
);
}
Program: 33629
Project: 33629
Buggy source:
/** 
 * Init Connection
 * @param configuration @see{com.stratio.connector.deep.configuration.ConnectionConfiguration}
 */
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(new ConnectionConfiguration());
  this.deepContext=ConnectionConfiguration.getDeepContext();
}

Fixed version (ground truth):
/** 
 * Init Connection
 * @param configuration
 * @see{com.stratio.connector.deep.configuration.ConnectionConfiguration
 */
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(null);
  this.deepContext=ConnectionConfiguration.getDeepContext();
}
Program: 33630
Project: 33630
Buggy source:
/** 
 * Check if the  connection associate to the clusterName is connected  {@link com.stratio.connector.commons.connection.ConnectionHandler.isConnected}
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}
 * @return boolean
 */
@Override public boolean isConnected(ClusterName name){
  return connectionHandler.isConnected(name.getName());
}

Fixed version (ground truth):
/** 
 * Check if the connection associate to the clusterName is connected  {@link com.stratio.connector.commons.connection.ConnectionHandler.isConnected}
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}
 * @return boolean
 */
@Override public boolean isConnected(ClusterName name){
  return connectionHandler.isConnected(name.getName());
}
Program: 33631
Project: 33631
Buggy source:
/** 
 * Close connection associate to the clusterName
 * @see{com.stratio.connector.commons.connection.ConnectionHandler.close }
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}
 */
@Override public void close(ClusterName name) throws ConnectionException {
  connectionHandler.closeConnection(name.getName());
}

Fixed version (ground truth):
/** 
 * Close connection associate to the clusterName
 * @see{com.stratio.connector.commons.connection.ConnectionHandler.close
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}
 */
@Override public void close(ClusterName name) throws ConnectionException {
  connectionHandler.closeConnection(name.getName());
}
Program: 33632
Project: 33632
Buggy source:
private ConnectionConfiguration(){
}

Fixed version (ground truth):
public ConnectionConfiguration(){
}
Program: 33634
Project: 33634
Buggy source:
@BeforeClass public static void setUp() throws InitializationException, ConnectionException, UnsupportedException {
  ConnectionsHandler connectionBuilder=new ConnectionsHandler();
  connectionBuilder.connect(CassandraConnectionConfigurationBuilder.prepareConfiguration());
  connectionBuilder.connect(MongoConnectionConfigurationBuilder.prepareConfiguration());
  deepQueryEngine=connectionBuilder.getQueryEngine();
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws InitializationException, ConnectionException, UnsupportedException {
  ConnectionsHandler connectionBuilder=new ConnectionsHandler();
  connectionBuilder.connect(CassandraConnectionConfigurationBuilder.prepareConfiguration());
  connectionBuilder.connect(MongoConnectionConfigurationBuilder.prepareConfiguration());
  deepQueryEngine=connectionBuilder.getQueryEngine();
  prepareDataForCassandra();
}
Program: 33638
Project: 33638
Buggy source:
@Test public void singleProjectWithOneFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE2_CONSTANT,Arrays.asList(ARTIST_CONSTANT,AGE_CONSTANT,RATE_CONSTANT,ACTIVE_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,RATE_CONSTANT,Operator.LET,RATE_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE2_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",41,rowsList.size());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT+ "String_Node_Str"+ ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT,columnsMetadata.get(0).getTableName());
  for (  Row row : rowsList) {
    assertEquals("String_Node_Str",1,row.size());
    assertNotNull("String_Node_Str",row.getCell(ARTIST_ALIAS_CONSTANT));
  }
}

Fixed version (ground truth):
@Test public void singleProjectWithOneFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE2_CONSTANT,Arrays.asList(ARTIST_CONSTANT,AGE_CONSTANT,RATE_CONSTANT,ACTIVE_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,RATE_CONSTANT,Operator.LET,RATE_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE2_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",40,rowsList.size());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT+ "String_Node_Str"+ ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT,columnsMetadata.get(0).getTableName());
  for (  Row row : rowsList) {
    assertEquals("String_Node_Str",1,row.size());
    assertNotNull("String_Node_Str",row.getCell(ARTIST_ALIAS_CONSTANT));
  }
}
Program: 33643
Project: 33643
Buggy source:
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(configuration);
  this.deepContext=ConnectionConfiguration.getDeepContext();
}

Fixed version (ground truth):
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(new ConnectionConfiguration());
  this.deepContext=ConnectionConfiguration.getDeepContext();
}
Program: 33644
Project: 33644
Buggy source:
public static void main(String[] args){
  DeepConnector conn=new DeepConnector();
}

Fixed version (ground truth):
public static void main(String[] args){
  DeepConnector deepConnector=new DeepConnector();
  ConnectorApp connectorApp=new ConnectorApp();
  connectorApp.startup(deepConnector);
}
Program: 33645
Project: 33645
Buggy source:
@Override public int compareTo(T o){
  if (!(this.clazz.isInstance(o))) {
    try {
      if ((this.clazz).equals(Long.class)) {
        Integer value=Integer.valueOf(this.getStringValue());
        Integer obj=Integer.valueOf(o.toString());
        return value.compareTo(obj);
      }
 else       if ((this.clazz).equals(Float.class)) {
        Float value=Float.valueOf(this.getStringValue());
        Float obj=Float.valueOf(o.toString());
        return value.compareTo(obj);
      }
    }
 catch (    NumberFormatException|ClassCastException e) {
    }
    return -1;
  }
  return this.value.compareTo(o);
}

Fixed version (ground truth):
@Override public int compareTo(T o){
  if (!(this.clazz.isInstance(o))) {
    try {
      if ((this.clazz).equals(Long.class)) {
        Integer value=Integer.valueOf(this.getStringValue());
        Integer obj=Integer.valueOf(o.toString());
        return value.compareTo(obj);
      }
 else       if ((this.clazz).equals(Double.class)) {
        Double value=Double.valueOf(this.getStringValue());
        Double obj=Double.valueOf(o.toString());
        return value.compareTo(obj);
      }
    }
 catch (    NumberFormatException|ClassCastException e) {
    }
    return -1;
  }
  return this.value.compareTo(o);
}
Program: 33646
Project: 33646
Buggy source:
@Override public int compareTo(T o){
  return this.value.compareTo(o);
}

Fixed version (ground truth):
@Override public int compareTo(T o){
  if (!(this.clazz.isInstance(o))) {
    try {
      if ((this.clazz).equals(Long.class)) {
        Integer value=Integer.valueOf(this.getStringValue());
        Integer obj=Integer.valueOf(o.toString());
        return value.compareTo(obj);
      }
 else       if ((this.clazz).equals(Float.class)) {
        Float value=Float.valueOf(this.getStringValue());
        Float obj=Float.valueOf(o.toString());
        return value.compareTo(obj);
      }
    }
 catch (    NumberFormatException|ClassCastException e) {
    }
    return -1;
  }
  return this.value.compareTo(o);
}
Program: 33647
Project: 33647
Buggy source:
public void testSingleProjectWithOneNonIndexIntegerFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE1_CONSTANT,Arrays.asList(ID_CONSTANT,ARTIST_CONSTANT,DESCRIPTION_CONSTANT,TITLE_CONSTANT,YEAR_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,ID_CONSTANT,Operator.LET,ID_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE1_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",1,rowsList.size());
  assertEquals("String_Node_Str",ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE1_CONSTANT,columnsMetadata.get(0).getTableName());
}

Fixed version (ground truth):
@Test public void testSingleProjectWithOneNonIndexIntegerFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE1_CONSTANT,Arrays.asList(ID_CONSTANT,ARTIST_CONSTANT,DESCRIPTION_CONSTANT,TITLE_CONSTANT,YEAR_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,ID_CONSTANT,Operator.LET,ID_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE1_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",1,rowsList.size());
  assertEquals("String_Node_Str",ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE1_CONSTANT,columnsMetadata.get(0).getTableName());
}
Program: 33648
Project: 33648
Buggy source:
@Test public void testSingleProjectWithOneFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE2_CONSTANT,Arrays.asList(ARTIST_CONSTANT,AGE_CONSTANT,RATE_CONSTANT,ACTIVE_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,AGE_CONSTANT,Operator.EQ,AGE_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE2_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",1,rowsList.size());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT+ "String_Node_Str"+ ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT,columnsMetadata.get(0).getTableName());
  for (  Row row : rowsList) {
    assertEquals("String_Node_Str",1,row.size());
    assertNotNull("String_Node_Str",row.getCell(ARTIST_ALIAS_CONSTANT));
  }
}

Fixed version (ground truth):
@Test public void testSingleProjectWithOneFilterAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,KEYSPACE,MYTABLE2_CONSTANT,Arrays.asList(ARTIST_CONSTANT,AGE_CONSTANT,RATE_CONSTANT,ACTIVE_CONSTANT));
  project.setNextStep(createFilter(KEYSPACE,MYTABLE1_CONSTANT,RATE_CONSTANT,Operator.LET,RATE_EX,false));
  LogicalStep filter=project.getNextStep();
  filter.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE,MYTABLE2_CONSTANT,ARTIST_CONSTANT)),Arrays.asList(ARTIST_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",1,rowsList.size());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT+ "String_Node_Str"+ ARTIST_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",KEYSPACE + "String_Node_Str" + MYTABLE2_CONSTANT,columnsMetadata.get(0).getTableName());
  for (  Row row : rowsList) {
    assertEquals("String_Node_Str",1,row.size());
    assertNotNull("String_Node_Str",row.getCell(ARTIST_ALIAS_CONSTANT));
  }
}
Program: 33649
Project: 33649
Buggy source:
private static Serializable filterFromRightTermWhereRelation(Relation relation) throws ExecutionException {
  SelectorType type=relation.getRightTerm().getType();
  Serializable rightField=null;
switch (type) {
case STRING:
    rightField=((StringSelector)relation.getRightTerm()).getValue();
  break;
case BOOLEAN:
rightField=((BooleanSelector)relation.getRightTerm()).getValue();
break;
case INTEGER:
rightField=((IntegerSelector)relation.getRightTerm()).getValue();
rightField=((Long)rightField).intValue();
break;
case FLOATING_POINT:
rightField=((FloatingPointSelector)relation.getRightTerm()).getValue();
break;
default :
throw new ExecutionException("String_Node_Str" + relation.getLeftTerm().getType() + "String_Node_Str");
}
return rightField;
}

Fixed version (ground truth):
private static Term filterFromRightTermWhereRelation(Relation relation) throws ExecutionException {
  SelectorType type=relation.getRightTerm().getType();
  Term rightField=null;
switch (type) {
case STRING:
    rightField=new StringTerm(((StringSelector)relation.getRightTerm()).getValue());
  break;
case BOOLEAN:
rightField=new BooleanTerm(((BooleanSelector)relation.getRightTerm()).toString());
break;
case INTEGER:
rightField=new LongTerm(((IntegerSelector)relation.getRightTerm()).toString());
break;
case FLOATING_POINT:
rightField=new DoubleTerm(((FloatingPointSelector)relation.getRightTerm()).toString());
break;
default :
throw new ExecutionException("String_Node_Str" + relation.getLeftTerm().getType() + "String_Node_Str");
}
return rightField;
}
Program: 33650
Project: 33650
Buggy source:
/** 
 * Take a RDD and a Relation and apply suitable filter to the RDD. Execute where clause on Deep.
 * @param rdd RDD which filter must be applied.
 * @param relation {@link com.stratio.meta.common.statements.structures.relationships.Relation} to apply
 * @return A new RDD with the result.
 * @throws UnsupportedException
 */
static JavaRDD<Cells> doWhere(JavaRDD<Cells> rdd,Relation relation) throws UnsupportedException, ExecutionException {
  Operator operator=relation.getOperator();
  JavaRDD<Cells> result=null;
  Serializable field=filterFromLeftTermWhereRelation(relation);
  Serializable rightTerm=filterFromRightTermWhereRelation(relation);
  logger.debug("String_Node_Str" + rdd.count());
switch (operator) {
case EQ:
    result=rdd.filter(new DeepEquals(field.toString(),rightTerm));
  break;
case DISTINCT:
result=rdd.filter(new NotEquals(field.toString(),rightTerm));
break;
case GT:
result=rdd.filter(new GreaterThan(field.toString(),rightTerm));
break;
case GET:
result=rdd.filter(new GreaterEqualThan(field.toString(),rightTerm));
break;
case LT:
result=rdd.filter(new LessThan(field.toString(),rightTerm));
break;
case LET:
result=rdd.filter(new LessEqualThan(field.toString(),rightTerm));
break;
case IN:
throw new UnsupportedException("String_Node_Str");
case BETWEEN:
throw new UnsupportedException("String_Node_Str");
default :
logger.error("String_Node_Str" + operator);
result=null;
}
return result;
}

Fixed version (ground truth):
/** 
 * Take a RDD and a Relation and apply suitable filter to the RDD. Execute where clause on Deep.
 * @param rdd RDD which filter must be applied.
 * @param relation {@link com.stratio.meta.common.statements.structures.relationships.Relation} to apply
 * @return A new RDD with the result.
 * @throws UnsupportedException
 */
static JavaRDD<Cells> doWhere(JavaRDD<Cells> rdd,Relation relation) throws UnsupportedException, ExecutionException {
  Operator operator=relation.getOperator();
  JavaRDD<Cells> result=null;
  Serializable field=filterFromLeftTermWhereRelation(relation);
  Term rightTerm=filterFromRightTermWhereRelation(relation);
  logger.debug("String_Node_Str" + rdd.count());
switch (operator) {
case EQ:
    result=rdd.filter(new DeepEquals(field.toString(),rightTerm));
  break;
case DISTINCT:
result=rdd.filter(new NotEquals(field.toString(),rightTerm));
break;
case GT:
result=rdd.filter(new GreaterThan(field.toString(),rightTerm));
break;
case GET:
result=rdd.filter(new GreaterEqualThan(field.toString(),rightTerm));
break;
case LT:
result=rdd.filter(new LessThan(field.toString(),rightTerm));
break;
case LET:
result=rdd.filter(new LessEqualThan(field.toString(),rightTerm));
break;
case IN:
throw new UnsupportedException("String_Node_Str");
case BETWEEN:
throw new UnsupportedException("String_Node_Str");
default :
logger.error("String_Node_Str" + operator);
result=null;
}
result.collect();
return result;
}
Program: 33651
Project: 33651
Buggy source:
/** 
 * DeepEquals apply = filter to a field in a Deep Cell.
 * @param field Name of the field to check.
 * @param term Term to compare to.
 */
public DeepEquals(String field,Serializable term){
  this.term=term;
  this.field=field;
}

Fixed version (ground truth):
/** 
 * DeepEquals apply = filter to a field in a Deep Cell.
 * @param field Name of the field to check.
 * @param term Term to compare to.
 */
public DeepEquals(String field,Term<?> term){
  this.term=term;
  this.field=field;
}
Program: 33652
Project: 33652
Buggy source:
/** 
 * DeepEquals apply <> filter to a field in a Deep Cell.
 * @param field Name of the field to check.
 * @param term Term to compare to.
 */
public NotEquals(String field,Serializable term){
  this.term=term;
  this.field=field;
}

Fixed version (ground truth):
/** 
 * DeepEquals apply <> filter to a field in a Deep Cell.
 * @param field Name of the field to check.
 * @param term Term to compare to.
 */
public NotEquals(String field,Term term){
  this.term=term;
  this.field=field;
}
Program: 33653
Project: 33653
Buggy source:
/** 
 * @param cells
 * @return
 */
private Row buildRowFromCells(Cells cells,Map<ColumnName,String> columnMap){
  Row row=new Row();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    com.stratio.deep.commons.entity.Cell cellsCell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    Cell rowCell=new Cell(cellsCell.getCellValue());
    row.addCell(columnItem.getValue(),rowCell);
  }
  return row;
}

Fixed version (ground truth):
/** 
 * @param cells
 * @return
 */
private Row buildRowFromCells(Cells cells,Map<ColumnName,String> columnMap){
  Row row=new Row();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    com.stratio.deep.commons.entity.Cell cellsCell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
    Cell rowCell=new Cell(cellsCell.getCellValue());
    row.addCell(columnItem.getValue(),rowCell);
  }
  return row;
}
Program: 33654
Project: 33654
Buggy source:
/** 
 * @param cells
 * @return
 */
private Row buildRowFromCells(Cells cells,Map<ColumnName,String> columnMap){
  Row row=new Row();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    com.stratio.deep.commons.entity.Cell cellsCell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
    Cell rowCell=new Cell(cellsCell.getCellValue());
    row.addCell(columnItem.getValue(),rowCell);
  }
  return row;
}

Fixed version (ground truth):
/** 
 * @param cells
 * @return
 */
private Row buildRowFromCells(Cells cells,Map<ColumnName,String> columnMap){
  Row row=new Row();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    com.stratio.deep.commons.entity.Cell cellsCell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    Cell rowCell=new Cell(cellsCell.getCellValue());
    row.addCell(columnItem.getValue(),rowCell);
  }
  return row;
}
Program: 33655
Project: 33655
Buggy source:
/** 
 * @param resultRdd
 * @return
 */
private QueryResult buildQueryResult(JavaRDD<Cells> resultRdd,Select selectStep){
  List<Cells> resultCells=resultRdd.collect();
  Map<ColumnName,String> columnMap=selectStep.getColumnMap();
  Map<String,ColumnType> columnType=selectStep.getTypeMap();
  List<ColumnMetadata> resultMetadata=new LinkedList<>();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    String columnAlias=columnItem.getValue();
    ColumnMetadata columnMetadata=new ColumnMetadata(columnName.getTableName().getQualifiedName(),columnName.getName());
    columnMetadata.setColumnAlias(columnAlias);
    columnMetadata.setType(columnType.get(columnAlias));
  }
  List<Row> resultRows=new LinkedList<>();
  for (  Cells cells : resultCells) {
    resultRows.add(buildRowFromCells(cells,columnMap));
  }
  ResultSet resultSet=new ResultSet();
  resultSet.setRows(resultRows);
  QueryResult queryResult=QueryResult.createQueryResult(resultSet);
  return queryResult;
}

Fixed version (ground truth):
/** 
 * @param resultRdd
 * @return
 */
private QueryResult buildQueryResult(JavaRDD<Cells> resultRdd,Select selectStep){
  List<Cells> resultCells=resultRdd.collect();
  Map<ColumnName,String> columnMap=selectStep.getColumnMap();
  Map<String,ColumnType> columnType=selectStep.getTypeMap();
  List<ColumnMetadata> resultMetadata=new LinkedList<>();
  for (  Entry<ColumnName,String> columnItem : columnMap.entrySet()) {
    ColumnName columnName=columnItem.getKey();
    String columnAlias=columnItem.getValue();
    ColumnMetadata columnMetadata=new ColumnMetadata(columnName.getTableName().getQualifiedName(),columnName.getName());
    columnMetadata.setColumnAlias(columnAlias);
    columnMetadata.setType(columnType.get(columnName.getQualifiedName()));
    resultMetadata.add(columnMetadata);
  }
  List<Row> resultRows=new LinkedList<>();
  for (  Cells cells : resultCells) {
    resultRows.add(buildRowFromCells(cells,columnMap));
  }
  ResultSet resultSet=new ResultSet();
  resultSet.setRows(resultRows);
  resultSet.setColumnMetadata(resultMetadata);
  QueryResult queryResult=QueryResult.createQueryResult(resultSet);
  return queryResult;
}
Program: 33656
Project: 33656
Buggy source:
@Test public void testSingleProjectAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,TWITTER_CONSTANT,MYTABLE1_CONSTANT,Arrays.asList(AUTHOR_CONSTANT,DESCRIPTION_CONSTANT));
  project.setNextStep(createSelect(Arrays.asList(createColumn(TWITTER_CONSTANT,MYTABLE1_CONSTANT,AUTHOR_CONSTANT)),Arrays.asList(AUTHOR_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
}

Fixed version (ground truth):
@Test public void testSingleProjectAndSelectTest() throws UnsupportedException, ExecutionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CASSANDRA_CLUSTERNAME_CONSTANT,TWITTER_CONSTANT,MYTABLE1_CONSTANT,Arrays.asList(AUTHOR_CONSTANT,DESCRIPTION_CONSTANT));
  project.setNextStep(createSelect(Arrays.asList(createColumn(TWITTER_CONSTANT,MYTABLE1_CONSTANT,AUTHOR_CONSTANT)),Arrays.asList(AUTHOR_ALIAS_CONSTANT)));
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  QueryResult result=deepQueryEngine.executeWorkFlow(logicalWorkflow);
  List<ColumnMetadata> columnsMetadata=result.getResultSet().getColumnMetadata();
  List<Row> rowsList=result.getResultSet().getRows();
  assertEquals("String_Node_Str",1,columnsMetadata.size());
  assertEquals("String_Node_Str",7,rowsList.size());
  assertEquals("String_Node_Str",AUTHOR_CONSTANT,columnsMetadata.get(0).getColumnName());
  assertEquals("String_Node_Str",TWITTER_CONSTANT + "String_Node_Str" + MYTABLE1_CONSTANT,columnsMetadata.get(0).getTableName());
  for (  Row row : rowsList) {
    assertEquals("String_Node_Str",1,row.size());
    assertNotNull("String_Node_Str",row.getCell(AUTHOR_ALIAS_CONSTANT));
  }
}
Program: 33658
Project: 33658
Buggy source:
/** 
 * Build a   {@link com.stratio.meta.common.data.CResultSetIterator} from a{@link com.stratio.meta.common.data.CassandraResultSet}.
 * @param deepResultSet Cassandra Result Set.
 */
public DeepResultSetIterator(DeepResultSet deepResultSet){
  this.deepResultSet=deepResultSet;
  this.current=0;
}

Fixed version (ground truth):
/** 
 * Build a   {@link com.stratio.connector.deep.data.DeepResultSet}
 * @param deepResultSet Result Set.
 */
public DeepResultSetIterator(DeepResultSet deepResultSet){
  this.deepResultSet=deepResultSet;
  this.current=0;
}
Program: 33659
Project: 33659
Buggy source:
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells(cells.getDefaultTableName());
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    cellsOut.add(Cell.create(cell.getCellName(),cell));
  }
  return cellsOut;
}

Fixed version (ground truth):
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells();
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
    cellsOut.add(columnName.getTableName().getQualifiedName(),cell);
  }
  return cellsOut;
}
Program: 33661
Project: 33661
Buggy source:
public static Select createSelect(List<ColumnName> columnsList,List<String> aliasNamesList){
  Map<ColumnName,String> columnsAliases=new HashMap<>();
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  Iterator<String> aliasesIt=aliasNamesList.iterator();
  for (  ColumnName column : columnsList) {
    columnsAliases.put(column,aliasesIt.next());
    columnsTypes.put(column.getQualifiedName(),ColumnType.BIGINT);
  }
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes);
  return select;
}

Fixed version (ground truth):
public static Select createSelect(List<ColumnName> columnsList,List<String> aliasNamesList){
  Map<ColumnName,String> columnsAliases=new LinkedHashMap<>();
  Map<String,ColumnType> columnsTypes=new LinkedHashMap<>();
  Iterator<String> aliasesIt=aliasNamesList.iterator();
  for (  ColumnName column : columnsList) {
    columnsAliases.put(column,aliasesIt.next());
    columnsTypes.put(column.getQualifiedName(),ColumnType.BIGINT);
  }
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes);
  return select;
}
Program: 33662
Project: 33662
Buggy source:
/** 
 * @param selectStep
 * @param rdd
 */
private void prepareResult(Select selectStep,JavaRDD<Cells> rdd) throws ExecutionException {
  rdd=QueryFilterUtils.filterSelectedColumns(rdd,selectStep.getColumnMap().keySet());
}

Fixed version (ground truth):
/** 
 * @param selectStep
 * @param rdd
 */
private JavaRDD<Cells> prepareResult(Select selectStep,JavaRDD<Cells> rdd) throws ExecutionException {
  return QueryFilterUtils.filterSelectedColumns(rdd,selectStep.getColumnMap().keySet());
}
Program: 33663
Project: 33663
Buggy source:
/** 
 * @param leftRdd
 * @param rdd
 * @param joinRelations
 */
private void executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations){
  rdd=QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations);
}

Fixed version (ground truth):
/** 
 * @param leftRdd
 * @param rdd
 * @param joinRelations
 */
private JavaRDD<Cells> executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations){
  return QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations);
}
Program: 33664
Project: 33664
Buggy source:
/** 
 * @param unionStep
 * @param rdd
 * @throws ExecutionException
 */
private boolean executeUnion(UnionStep unionStep,JavaRDD<Cells> rdd) throws ExecutionException {
  boolean unionSucceed=false;
  if (unionStep instanceof Join) {
    Join joinStep=(Join)unionStep;
    String joinLeftTableName=joinStep.getSourceIdentifiers().get(0);
    JavaRDD<Cells> leftRdd=partialResultsMap.get(joinLeftTableName);
    if (leftRdd != null) {
      executeJoin(leftRdd,rdd,joinStep.getJoinRelations());
      partialResultsMap.remove(joinLeftTableName);
      partialResultsMap.put(joinStep.getId(),rdd);
      unionSucceed=true;
    }
  }
 else {
    throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
  }
  return unionSucceed;
}

Fixed version (ground truth):
/** 
 * @param unionStep
 * @param rdd
 * @throws ExecutionException
 */
private JavaRDD<Cells> executeUnion(UnionStep unionStep,JavaRDD<Cells> rdd) throws ExecutionException {
  JavaRDD<Cells> joinedRdd=null;
  if (unionStep instanceof Join) {
    Join joinStep=(Join)unionStep;
    String joinLeftTableName=joinStep.getSourceIdentifiers().get(0);
    JavaRDD<Cells> leftRdd=partialResultsMap.get(joinLeftTableName);
    if (leftRdd != null) {
      joinedRdd=executeJoin(leftRdd,rdd,joinStep.getJoinRelations());
      partialResultsMap.remove(joinLeftTableName);
      partialResultsMap.put(joinStep.getId(),rdd);
    }
  }
 else {
    throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
  }
  return joinedRdd;
}
Program: 33665
Project: 33665
Buggy source:
/** 
 * @param logicalStep
 * @param rdd
 * @return
 * @throws ExecutionException
 * @throws UnsupportedException
 */
private JavaRDD<Cells> executeInitialStep(LogicalStep logicalStep,JavaRDD<Cells> rdd,String tableName) throws ExecutionException, UnsupportedException {
  String stepId=tableName;
  LogicalStep currentStep=logicalStep;
  while (currentStep != null) {
    if (currentStep instanceof Filter) {
      rdd=executeFilter((Filter)currentStep,rdd);
      List<Cells> resultList=rdd.collect();
      resultList.size();
    }
 else     if (currentStep instanceof Select) {
      prepareResult((Select)currentStep,rdd);
    }
 else     if (currentStep instanceof UnionStep) {
      UnionStep unionStep=(UnionStep)currentStep;
      if (!executeUnion(unionStep,rdd)) {
        break;
      }
 else {
        if (unionStep instanceof Join) {
          stepId=((Join)unionStep).getId();
        }
 else {
          throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
        }
      }
    }
 else {
      throw new ExecutionException("String_Node_Str" + currentStep.getOperation().toString() + "String_Node_Str");
    }
    currentStep=currentStep.getNextStep();
  }
  partialResultsMap.put(stepId,rdd);
  return rdd;
}

Fixed version (ground truth):
/** 
 * @param logicalStep
 * @param rdd
 * @return
 * @throws ExecutionException
 * @throws UnsupportedException
 */
private JavaRDD<Cells> executeInitialStep(LogicalStep logicalStep,JavaRDD<Cells> rdd,String tableName) throws ExecutionException, UnsupportedException {
  String stepId=tableName;
  LogicalStep currentStep=logicalStep;
  while (currentStep != null) {
    if (currentStep instanceof Filter) {
      rdd=executeFilter((Filter)currentStep,rdd);
      List<Cells> resultList=rdd.collect();
      resultList.size();
    }
 else     if (currentStep instanceof Select) {
      rdd=prepareResult((Select)currentStep,rdd);
    }
 else     if (currentStep instanceof UnionStep) {
      UnionStep unionStep=(UnionStep)currentStep;
      JavaRDD<Cells> joinedRdd=executeUnion(unionStep,rdd);
      if (joinedRdd == null) {
        break;
      }
 else {
        rdd=joinedRdd;
        if (unionStep instanceof Join) {
          stepId=((Join)unionStep).getId();
        }
 else {
          throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
        }
      }
    }
 else {
      throw new ExecutionException("String_Node_Str" + currentStep.getOperation().toString() + "String_Node_Str");
    }
    currentStep=currentStep.getNextStep();
  }
  partialResultsMap.put(stepId,rdd);
  return rdd;
}
Program: 33666
Project: 33666
Buggy source:
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells(cells.getnameSpace());
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    cellsOut.add(cell);
  }
  return cellsOut;
}

Fixed version (ground truth):
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells(cells.getnameSpace());
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
    cellsOut.add(cell);
  }
  return cellsOut;
}