nus-yam/ex-repair huggingface dataset:
Program: 96062
Project: 96062
Buggy source:
@Override public void createMetaTablesInDMBS(TableUniqueName originalTableName,TableUniqueName sizeTableName,TableUniqueName nameTableName) throws VerdictException {
  VerdictLogger.debug(this,"String_Node_Str");
  String sql=String.format("String_Node_Str",sizeTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  sql=String.format("String_Node_Str",nameTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  VerdictLogger.debug(this,"String_Node_Str");
}

Fixed version (ground truth):
public void createMetaTablesInDMBS(TableUniqueName originalTableName,TableUniqueName sizeTableName,TableUniqueName nameTableName) throws VerdictException {
  VerdictLogger.debug(this,"String_Node_Str");
  String sql=String.format("String_Node_Str",sizeTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  sql=String.format("String_Node_Str",nameTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  VerdictLogger.debug(this,"String_Node_Str");
}
Program: 96063
Project: 96063
Buggy source:
@Override public void createMetaTablesInDMBS(TableUniqueName originalTableName,TableUniqueName sizeTableName,TableUniqueName nameTableName) throws VerdictException {
  VerdictLogger.debug(this,"String_Node_Str");
  String sql=String.format("String_Node_Str",sizeTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  sql=String.format("String_Node_Str",nameTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  VerdictLogger.debug(this,"String_Node_Str");
}

Fixed version (ground truth):
public void createMetaTablesInDMBS(TableUniqueName originalTableName,TableUniqueName sizeTableName,TableUniqueName nameTableName) throws VerdictException {
  VerdictLogger.debug(this,"String_Node_Str");
  String sql=String.format("String_Node_Str",sizeTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  sql=String.format("String_Node_Str",nameTableName) + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  executeUpdate(sql);
  VerdictLogger.debug(this,"String_Node_Str");
}
Program: 96066
Project: 96066
Buggy source:
@Override public Pair<Cond,Pair<ExactRelation,ExactRelation>> searchForJoinCondition(List<ExactRelation> tableSources){
  if (compOp.equals("String_Node_Str")) {
    if (left instanceof ColNameExpr && right instanceof ColNameExpr) {
      String leftTab=((ColNameExpr)left).getTab();
      String rightTab=((ColNameExpr)right).getTab();
      ExactRelation r1=tableSources.get(0);
      ExactRelation r2=null;
      if (doesRelationContain(r1,leftTab)) {
        r2=findSourceContaining(tableSources,rightTab);
      }
 else       if (doesRelationContain(r1,rightTab)) {
        r2=findSourceContaining(tableSources,leftTab);
      }
      if (r2 != null && r1 != r2) {
        return Pair.of((Cond)this,Pair.of(r1,r2));
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Pair<Cond,Pair<ExactRelation,ExactRelation>> searchForJoinCondition(List<ExactRelation> tableSources){
  if (compOp.equals("String_Node_Str")) {
    if (left instanceof ColNameExpr && right instanceof ColNameExpr) {
      String leftTab=((ColNameExpr)left).getTab();
      String rightTab=((ColNameExpr)right).getTab();
      ExactRelation r1=tableSources.get(0);
      ExactRelation r2=null;
      if (doesRelationContain(r1,leftTab)) {
        r2=findSourceContaining(tableSources,rightTab);
        if (r2 != null && r2 instanceof JoinedRelation) {
          r2=findSingleRelation(r2,rightTab);
        }
      }
 else       if (doesRelationContain(r1,rightTab)) {
        r2=findSourceContaining(tableSources,leftTab);
        if (r2 != null && r2 instanceof JoinedRelation) {
          r2=findSingleRelation(r2,leftTab);
        }
      }
      String leftOriginalName=getOriginalTableName(tableSources,leftTab);
      String rightOriginalName=getOriginalTableName(tableSources,rightTab);
      if (r2 != null && leftOriginalName != null && rightOriginalName != null && !leftOriginalName.equals(rightOriginalName)) {
        return Pair.of((Cond)this,Pair.of(r1,r2));
      }
    }
  }
  return null;
}
Program: 96068
Project: 96068
Buggy source:
public SampleSizeInfo(long sampleSize,long originalTableSize){
  this.sampleSize=sampleSize;
  this.originalTableSize=originalTableSize;
}

Fixed version (ground truth):
public SampleSizeInfo(TableUniqueName originalTable,long sampleSize,long originalTableSize){
  this.originalTable=originalTable;
  this.sampleSize=sampleSize;
  this.originalTableSize=originalTableSize;
}
Program: 96069
Project: 96069
Buggy source:
@Override public double cost(){
  if (sampleType().equals("String_Node_Str")) {
    SampleParam ufParam=new SampleParam(vc,param.getOriginalTable(),"String_Node_Str",null,Arrays.<String>asList());
    TableUniqueName ufSample=vc.getMeta().lookForSampleTable(ufParam);
    SampleSizeInfo info=vc.getMeta().getSampleSizeOf(ufSample);
    return (info == null) ? 0 : info.originalTableSize;
  }
 else {
    SampleSizeInfo info=vc.getMeta().getSampleSizeOf(param);
    if (info == null) {
      return -1;
    }
    return info.sampleSize;
  }
}

Fixed version (ground truth):
@Override public double cost(){
  if (sampleType().equals("String_Node_Str")) {
    SampleSizeInfo info=vc.getMeta().getOriginalSizeOf(param.getOriginalTable());
    return (info == null) ? 0 : info.originalTableSize;
  }
 else {
    SampleSizeInfo info=vc.getMeta().getSampleSizeOf(param);
    if (info == null) {
      return -1;
    }
    return info.sampleSize;
  }
}
Program: 96070
Project: 96070
Buggy source:
public static ApproxSingleRelation asis(SingleRelation r){
  ApproxSingleRelation a=new ApproxSingleRelation(r.vc,r.getTableName(),new SampleParam(r.vc,r.getTableName(),"String_Node_Str",1.0,null),new SampleSizeInfo(-1,-1));
  a.setAlias(r.getAlias());
  return a;
}

Fixed version (ground truth):
public static ApproxSingleRelation asis(SingleRelation r){
  ApproxSingleRelation a=new ApproxSingleRelation(r.vc,r.getTableName(),new SampleParam(r.vc,r.getTableName(),"String_Node_Str",1.0,null),new SampleSizeInfo(r.getTableName(),-1,-1));
  a.setAlias(r.getAlias());
  return a;
}
Program: 96071
Project: 96071
Buggy source:
@Override public ExactRelation rewriteWithPartition(){
  ExactRelation newSource=source.rewriteWithPartition();
  List<Expr> newGroupby=groupbyWithTablesSubstituted();
  ColNameExpr partitionCol=newSource.partitionColumn();
  if (partitionCol != null) {
    partitionCol.setTab(getAlias());
    newGroupby.add(partitionCol);
  }
  ExactRelation r=new GroupedRelation(vc,newSource,newGroupby);
  r.setAlias(r.getAlias());
  return r;
}

Fixed version (ground truth):
@Override public ExactRelation rewriteWithPartition(){
  ExactRelation newSource=source.rewriteWithPartition();
  List<Expr> newGroupby=groupbyWithTablesSubstituted();
  ColNameExpr partitionCol=newSource.partitionColumn();
  if (partitionCol != null) {
    if (newSource instanceof ProjectedRelation || newSource instanceof AggregatedRelation) {
      partitionCol.setTab(getAlias());
    }
    newGroupby.add(partitionCol);
  }
  ExactRelation r=new GroupedRelation(vc,newSource,newGroupby);
  r.setAlias(r.getAlias());
  return r;
}
Program: 96072
Project: 96072
Buggy source:
@Override public void cancel() throws SQLException {
  System.out.print("String_Node_Str");
  stmt.cancel();
}

Fixed version (ground truth):
@Override public void cancel() throws SQLException {
}
Program: 96073
Project: 96073
Buggy source:
@Override public void cancel() throws SQLException {
  stmt.cancel();
}

Fixed version (ground truth):
@Override public void cancel() throws SQLException {
  System.out.print("String_Node_Str");
  stmt.cancel();
  try {
    ((DbmsJDBC)vc.getDbms()).closeStatement();
  }
 catch (  VerdictException e) {
    new SQLException(StackTraceReader.stackTrace2String(e));
  }
}
Program: 96074
Project: 96074
Buggy source:
@Override public ExactRelation rewriteWithPartition(){
  ExactRelation newSource1=source1.rewriteWithPartition();
  ExactRelation newSource2=source2.rewriteWithPartition();
  List<Pair<Expr,Expr>> newJoinCond=joinCondWithTablesSubstitutioned();
  ExactRelation r=JoinedRelation.from(vc,newSource1,newSource2,newJoinCond);
  r.setAlias(getAlias());
  return r;
}

Fixed version (ground truth):
@Override public ExactRelation rewriteWithPartition(){
  ExactRelation newSource1=source1.rewriteWithPartition();
  ExactRelation newSource2=source2.rewriteWithPartition();
  List<Pair<Expr,Expr>> newJoinCond=joinCondWithTablesSubstitutioned();
  JoinedRelation r=JoinedRelation.from(vc,newSource1,newSource2,newJoinCond);
  r.setJoinType(getJoinType());
  r.setAlias(getAlias());
  return r;
}
Program: 96075
Project: 96075
Buggy source:
@Override protected String toStringWithIndent(String indent){
  return null;
}

Fixed version (ground truth):
@Override protected String toStringWithIndent(String indent){
  StringBuilder s=new StringBuilder(1000);
  s.append(indent);
  s.append(String.format("String_Node_Str",lateralFunc.toString(),tableAlias,columnAlias));
  return s.toString();
}
Program: 96076
Project: 96076
Buggy source:
@Override public Expr tupleProbabilityColumn(){
  return null;
}

Fixed version (ground truth):
@Override public Expr tupleProbabilityColumn(){
  return new ConstantExpr(vc,1.0);
}
Program: 96077
Project: 96077
Buggy source:
@Override public Expr tableSamplingRatio(){
  return null;
}

Fixed version (ground truth):
@Override public Expr tableSamplingRatio(){
  return new ConstantExpr(vc,1.0);
}
Program: 96078
Project: 96078
Buggy source:
@Deprecated protected abstract String toStringWithIndent(String indent);

Fixed version (ground truth):
protected abstract String toStringWithIndent(String indent);
Program: 96079
Project: 96079
Buggy source:
@Override protected List<ApproxRelation> nBestSamples(Expr elem,int n) throws VerdictException {
  List<ApproxRelation> ofSources1=source1.nBestSamples(elem,n);
  List<ApproxRelation> ofSources2=source2.nBestSamples(elem,n);
  List<ApproxRelation> joined=new ArrayList<ApproxRelation>();
  for (  ApproxRelation a1 : ofSources1) {
    for (    ApproxRelation a2 : ofSources2) {
      ApproxJoinedRelation j=new ApproxJoinedRelation(vc,a1,a2,joinCols);
      if (expectedSampleType(j.sampleType())) {
        joined.add(j);
      }
    }
  }
  return joined;
}

Fixed version (ground truth):
@Override protected List<ApproxRelation> nBestSamples(Expr elem,int n) throws VerdictException {
  List<ApproxRelation> ofSources1=source1.nBestSamples(elem,n);
  List<ApproxRelation> ofSources2=source2.nBestSamples(elem,n);
  List<ApproxRelation> joined=new ArrayList<ApproxRelation>();
  for (  ApproxRelation a1 : ofSources1) {
    for (    ApproxRelation a2 : ofSources2) {
      ApproxJoinedRelation j=new ApproxJoinedRelation(vc,a1,a2,joinCols);
      j.setJoinType(getJoinType());
      if (expectedSampleType(j.sampleType())) {
        joined.add(j);
      }
    }
  }
  return joined;
}
Program: 96080
Project: 96080
Buggy source:
@Override protected String toStringWithIndent(String indent){
  return null;
}

Fixed version (ground truth):
@Override protected String toStringWithIndent(String indent){
  StringBuilder s=new StringBuilder(1000);
  s.append(indent);
  s.append(String.format("String_Node_Str",lateralFunc.toString(),tableAlias,columnAlias));
  return s.toString();
}
Program: 96081
Project: 96081
Buggy source:
public static VerdictSpark2Context getVerdictContext(){
  return vc;
}

Fixed version (ground truth):
public static VerdictSparkHiveContext getVerdictContext(){
  return vc;
}
Program: 96082
Project: 96082
Buggy source:
private static void setup(){
  try {
    vc=new VerdictSpark2Context(sc);
    vc.sql("String_Node_Str" + database);
    hc=new HiveContext(sc);
    hc.sql("String_Node_Str" + database);
  }
 catch (  VerdictException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void setup(){
  try {
    vc=new VerdictSparkHiveContext(sc);
    vc.sql("String_Node_Str" + database);
    hc=new HiveContext(sc);
    hc.sql("String_Node_Str" + database);
  }
 catch (  VerdictException e) {
    e.printStackTrace();
  }
}
Program: 96083
Project: 96083
Buggy source:
@Override public List<String> getTables(String schema) throws VerdictException {
  List<String> tables=new ArrayList<String>();
  List<Row> rows=getTablesInDataFrame(schema).collectAsList();
  for (  Row row : rows) {
    String table=row.getString(0);
    tables.add(table);
  }
  return tables;
}

Fixed version (ground truth):
@Override public List<String> getTables(String schema) throws VerdictException {
  List<String> tables=new ArrayList<String>();
  List<Row> rows=getTablesInDataFrame(schema).collectAsList();
  for (  Row row : rows) {
    String table=row.getString(1);
    tables.add(table);
  }
  return tables;
}
Program: 96084
Project: 96084
Buggy source:
@Override public Set<String> getDatabases() throws VerdictException {
  Set<String> databases=new HashSet<String>();
  List<Row> rows=getDatabaseNamesInDataFrame().collectAsList();
  for (  Row row : rows) {
    String dbname=row.getString(0);
    databases.add(dbname);
  }
  return databases;
}

Fixed version (ground truth):
@Override public Set<String> getDatabases() throws VerdictException {
  Set<String> databases=new HashSet<String>();
  List<Row> rows=getDatabaseNamesInDataset().collectAsList();
  for (  Row row : rows) {
    String dbname=row.getString(0);
    databases.add(dbname);
  }
  return databases;
}
Program: 96085
Project: 96085
Buggy source:
@Override public Map<String,String> getColumns(TableUniqueName table) throws VerdictException {
  Map<String,String> col2type=new LinkedHashMap<String,String>();
  List<Row> rows=describeTableInDataFrame(table).collectAsList();
  for (  Row row : rows) {
    String column=row.getString(0);
    String type=row.getString(1);
    col2type.put(column,type);
  }
  return col2type;
}

Fixed version (ground truth):
@Override public Map<String,String> getColumns(TableUniqueName table) throws VerdictException {
  Map<String,String> col2type=new LinkedHashMap<String,String>();
  List<Row> rows=describeTableInDataset(table).collectAsList();
  for (  Row row : rows) {
    String column=row.getString(0);
    String type=row.getString(1);
    col2type.put(column,type);
  }
  return col2type;
}
Program: 96086
Project: 96086
Buggy source:
@Override public List<String> getTables(String schema) throws VerdictException {
  List<String> tables=new ArrayList<String>();
  List<Row> rows=getTablesInDataFrame(schema).collectAsList();
  for (  Row row : rows) {
    String table=row.getString(0);
    tables.add(table);
  }
  return tables;
}

Fixed version (ground truth):
@Override public List<String> getTables(String schema) throws VerdictException {
  List<String> tables=new ArrayList<String>();
  List<Row> rows=getTablesInDataset(schema).collectAsList();
  for (  Row row : rows) {
    String table=row.getString(0);
    tables.add(table);
  }
  return tables;
}
Program: 96087
Project: 96087
Buggy source:
@Override public void compute() throws VerdictException {
  VerdictSQLParser p=StringManipulations.parserOf(queryString);
  VerdictSQLBaseVisitor<TableUniqueName> visitor=new VerdictSQLBaseVisitor<TableUniqueName>(){
    private TableUniqueName tableName;
    protected TableUniqueName defaultResult(){
      return tableName;
    }
    @Override public TableUniqueName visitDescribe_table_statement(    VerdictSQLParser.Describe_table_statementContext ctx){
      String schema=null;
      Table_nameContext t=ctx.table_name();
      if (t.schema != null) {
        schema=t.schema.getText();
      }
      String table=t.table.getText();
      tableName=TableUniqueName.uname(schema,table);
      return tableName;
    }
  }
;
  TableUniqueName tableName=visitor.visit(p.describe_table_statement());
  TableUniqueName table=(tableName.getSchemaName() != null) ? tableName : TableUniqueName.uname(vc,tableName.getTableName());
  if (table.getSchemaName() == null) {
    VerdictLogger.info("String_Node_Str");
  }
 else {
    if (vc.getDbms().isJDBC()) {
      rs=((DbmsJDBC)vc.getDbms()).describeTableInResultSet(table);
    }
 else     if (vc.getDbms().isSpark()) {
      df=((DbmsSpark)vc.getDbms()).describeTableInDataFrame(table);
    }
 else     if (vc.getDbms().isSpark2()) {
      ds=((DbmsSpark2)vc.getDbms()).describeTableInDataFrame(table);
    }
  }
}

Fixed version (ground truth):
@Override public void compute() throws VerdictException {
  VerdictSQLParser p=StringManipulations.parserOf(queryString);
  VerdictSQLBaseVisitor<TableUniqueName> visitor=new VerdictSQLBaseVisitor<TableUniqueName>(){
    private TableUniqueName tableName;
    protected TableUniqueName defaultResult(){
      return tableName;
    }
    @Override public TableUniqueName visitDescribe_table_statement(    VerdictSQLParser.Describe_table_statementContext ctx){
      String schema=null;
      Table_nameContext t=ctx.table_name();
      if (t.schema != null) {
        schema=t.schema.getText();
      }
      String table=t.table.getText();
      tableName=TableUniqueName.uname(schema,table);
      return tableName;
    }
  }
;
  TableUniqueName tableName=visitor.visit(p.describe_table_statement());
  TableUniqueName table=(tableName.getSchemaName() != null) ? tableName : TableUniqueName.uname(vc,tableName.getTableName());
  if (table.getSchemaName() == null) {
    VerdictLogger.info("String_Node_Str");
  }
 else {
    if (vc.getDbms().isJDBC()) {
      rs=((DbmsJDBC)vc.getDbms()).describeTableInResultSet(table);
    }
 else     if (vc.getDbms().isSpark()) {
      df=((DbmsSpark)vc.getDbms()).describeTableInDataFrame(table);
    }
 else     if (vc.getDbms().isSpark2()) {
      ds=((DbmsSpark2)vc.getDbms()).describeTableInDataset(table);
    }
  }
}
Program: 96088
Project: 96088
Buggy source:
public Dataset<Row> getDataset(){
  if (ds == null && (vc.getDbms() instanceof DbmsSpark2)) {
    return ((DbmsSpark2)vc.getDbms()).emptyDataFrame();
  }
 else {
    return ds;
  }
}

Fixed version (ground truth):
public Dataset<Row> getDataset(){
  if (ds == null && (vc.getDbms() instanceof DbmsSpark2)) {
    return ((DbmsSpark2)vc.getDbms()).emptyDataset();
  }
 else {
    return ds;
  }
}
Program: 96089
Project: 96089
Buggy source:
@Override public void compute() throws VerdictException {
  if (vc.getDbms() instanceof DbmsJDBC) {
    rs=((DbmsJDBC)vc.getDbms()).getDatabaseNamesInResultSet();
  }
 else   if (vc.getDbms() instanceof DbmsSpark) {
    df=((DbmsSpark)vc.getDbms()).getDatabaseNamesInDataFrame();
  }
 else   if (vc.getDbms() instanceof DbmsSpark2) {
    ds=((DbmsSpark2)vc.getDbms()).getDatabaseNamesInDataFrame();
  }
}

Fixed version (ground truth):
@Override public void compute() throws VerdictException {
  if (vc.getDbms() instanceof DbmsJDBC) {
    rs=((DbmsJDBC)vc.getDbms()).getDatabaseNamesInResultSet();
  }
 else   if (vc.getDbms() instanceof DbmsSpark) {
    df=((DbmsSpark)vc.getDbms()).getDatabaseNamesInDataFrame();
  }
 else   if (vc.getDbms() instanceof DbmsSpark2) {
    ds=((DbmsSpark2)vc.getDbms()).getDatabaseNamesInDataset();
  }
}
Program: 96090
Project: 96090
Buggy source:
@Override public void compute() throws VerdictException {
  VerdictSQLParser p=StringManipulations.parserOf(queryString);
  VerdictSQLBaseVisitor<String> visitor=new VerdictSQLBaseVisitor<String>(){
    private String schemaName=null;
    protected String defaultResult(){
      return schemaName;
    }
    @Override public String visitShow_tables_statement(    VerdictSQLParser.Show_tables_statementContext ctx){
      if (ctx.schema != null) {
        schemaName=ctx.schema.getText();
      }
      return schemaName;
    }
  }
;
  String schema=visitor.visit(p.show_tables_statement());
  schema=(schema != null) ? schema : ((vc.getCurrentSchema().isPresent()) ? vc.getCurrentSchema().get() : null);
  if (schema == null) {
    VerdictLogger.info("String_Node_Str");
    return;
  }
 else {
    if (vc.getDbms().isJDBC()) {
      rs=((DbmsJDBC)vc.getDbms()).getTablesInResultSet(schema);
    }
 else     if (vc.getDbms().isSpark()) {
      df=((DbmsSpark)vc.getDbms()).getTablesInDataFrame(schema);
    }
 else     if (vc.getDbms().isSpark2()) {
      ds=((DbmsSpark2)vc.getDbms()).getTablesInDataFrame(schema);
    }
  }
}

Fixed version (ground truth):
@Override public void compute() throws VerdictException {
  VerdictSQLParser p=StringManipulations.parserOf(queryString);
  VerdictSQLBaseVisitor<String> visitor=new VerdictSQLBaseVisitor<String>(){
    private String schemaName=null;
    protected String defaultResult(){
      return schemaName;
    }
    @Override public String visitShow_tables_statement(    VerdictSQLParser.Show_tables_statementContext ctx){
      if (ctx.schema != null) {
        schemaName=ctx.schema.getText();
      }
      return schemaName;
    }
  }
;
  String schema=visitor.visit(p.show_tables_statement());
  schema=(schema != null) ? schema : ((vc.getCurrentSchema().isPresent()) ? vc.getCurrentSchema().get() : null);
  if (schema == null) {
    VerdictLogger.info("String_Node_Str");
    return;
  }
 else {
    if (vc.getDbms().isJDBC()) {
      rs=((DbmsJDBC)vc.getDbms()).getTablesInResultSet(schema);
    }
 else     if (vc.getDbms().isSpark()) {
      df=((DbmsSpark)vc.getDbms()).getTablesInDataFrame(schema);
    }
 else     if (vc.getDbms().isSpark2()) {
      ds=((DbmsSpark2)vc.getDbms()).getTablesInDataset(schema);
    }
  }
}
Program: 96091
Project: 96091
Buggy source:
public static String genColumnAlias(Expr expr){
  String a;
  if (expr instanceof ColNameExpr) {
    a=expr.getText();
  }
 else {
    a=String.format("String_Node_Str",expr.getText().substring(0,1),column_alias_num);
  }
  column_alias_num++;
  return a;
}

Fixed version (ground truth):
public static String genColumnAlias(Expr expr){
  String a;
  if (expr instanceof ColNameExpr) {
    a=((ColNameExpr)expr).getCol();
  }
 else {
    a=String.format("String_Node_Str",expr.getText().substring(0,1),column_alias_num);
  }
  column_alias_num++;
  return a;
}
Program: 96092
Project: 96092
Buggy source:
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  vc.destroy();
}

Fixed version (ground truth):
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  vc.destroy();
}
Program: 96093
Project: 96093
Buggy source:
protected TableUniqueName createUniformRandomSampledTable(SampleParam param) throws VerdictException {
  String whereClause=String.format("String_Node_Str",randNumColname,param.samplingRatio);
  ExactRelation sampled=SingleRelation.from(vc,param.getOriginalTable()).select(String.format("String_Node_Str",randomNumberExpression(param),randNumColname)).where(whereClause).select("String_Node_Str" + randomPartitionColumn());
  TableUniqueName temp=Relation.getTempTableName(vc,param.sampleTableName().getSchemaName());
  dropTable(temp);
  String sql=String.format("String_Node_Str",temp,sampled.toSql());
  VerdictLogger.debug(this,"String_Node_Str");
  VerdictLogger.debugPretty(this,Relation.prettyfySql(vc,sql),"String_Node_Str");
  executeUpdate(sql);
  return temp;
}

Fixed version (ground truth):
protected TableUniqueName createUniformRandomSampledTable(SampleParam param) throws VerdictException {
  String whereClause=String.format("String_Node_Str",randNumColname,param.samplingRatio);
  ExactRelation sampled=SingleRelation.from(vc,param.getOriginalTable()).select(String.format("String_Node_Str",randomNumberExpression(param),randNumColname)).where(whereClause).select("String_Node_Str" + randomPartitionColumn());
  TableUniqueName temp=Relation.getTempTableName(vc,param.sampleTableName().getSchemaName());
  dropTable(temp);
  String sql=String.format("String_Node_Str",temp,sampled.toSql());
  VerdictLogger.debug(this,"String_Node_Str");
  VerdictLogger.debug(this,sql);
  VerdictLogger.debugPretty(this,Relation.prettyfySql(vc,sql),"String_Node_Str");
  executeUpdate(sql);
  return temp;
}
Program: 96094
Project: 96094
Buggy source:
public void setAlias(String alias){
  this.alias=Optional.of(alias.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void setAlias(String alias){
  if (alias == null) {
    this.alias=Optional.fromNullable(alias);
  }
 else {
    this.alias=Optional.of(alias.replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  }
}
Program: 96097
Project: 96097
Buggy source:
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str");
  vc.executeJdbcQuery("String_Node_Str");
  vc.executeJdbcQuery("String_Node_Str");
  vc.destroy();
}

Fixed version (ground truth):
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str");
  vc.destroy();
}
Program: 96098
Project: 96098
Buggy source:
@Override protected Expr replaceColNameExpr(ColNameExpr expr){
  if (expr.getTab() != null) {
    if (expr.getSchema() != null) {
      TableUniqueName t=new TableUniqueName(expr.getSchema(),expr.getTab());
      if (tabAliasColumns.containsKey(t)) {
        return new ColNameExpr(vc,expr.getCol(),tabAliasColumns.get(t).getKey());
      }
    }
 else {
      TableUniqueName a=new TableUniqueName(null,expr.getTab());
      if (tabAliasColumns.containsKey(a)) {
        return new ColNameExpr(vc,expr.getCol(),tabAliasColumns.get(a).getKey());
      }
      TableUniqueName t=TableUniqueName.uname(vc,expr.getTab());
      if (tabAliasColumns.containsKey(t)) {
        return new ColNameExpr(vc,expr.getCol(),tabAliasColumns.get(t).getKey());
      }
    }
  }
 else {
    String col=expr.getCol();
    for (    Map.Entry<TableUniqueName,Pair<String,Set<String>>> e : tabAliasColumns.entrySet()) {
      Pair<String,Set<String>> aliasCols=e.getValue();
      if (aliasCols.getValue().contains(col)) {
        return new ColNameExpr(vc,col,aliasCols.getKey());
      }
    }
  }
  VerdictLogger.error(this,String.format("String_Node_Str",expr.toString()));
  return expr;
}

Fixed version (ground truth):
@Override protected Expr replaceColNameExpr(ColNameExpr expr){
  if (expr.getTab() != null) {
    if (expr.getSchema() != null) {
      TableUniqueName t=new TableUniqueName(expr.getSchema(),expr.getTab());
      if (tabAliasColumns.containsKey(t)) {
        return new ColNameExpr(vc,expr.getCol(),tabAliasColumns.get(t).getKey());
      }
    }
 else {
      for (      Pair<String,Set<String>> aliasColumns : tabAliasColumns.values()) {
        String alias=aliasColumns.getKey();
        if (alias.equals(expr.getTab())) {
          return expr;
        }
      }
      TableUniqueName t=TableUniqueName.uname(vc,expr.getTab());
      if (tabAliasColumns.containsKey(t)) {
        return new ColNameExpr(vc,expr.getCol(),tabAliasColumns.get(t).getKey());
      }
    }
  }
 else {
    String col=expr.getCol();
    for (    Map.Entry<TableUniqueName,Pair<String,Set<String>>> e : tabAliasColumns.entrySet()) {
      Pair<String,Set<String>> aliasCols=e.getValue();
      if (aliasCols.getValue().contains(col)) {
        return new ColNameExpr(vc,col,aliasCols.getKey());
      }
    }
  }
  VerdictLogger.error(this,String.format("String_Node_Str",expr.toString()));
  return expr;
}
Program: 96099
Project: 96099
Buggy source:
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  vc.destroy();
}

Fixed version (ground truth):
public static void main(String[] args) throws VerdictException, FileNotFoundException {
  VerdictConf conf=new VerdictConf();
  conf.setDbms("String_Node_Str");
  conf.setHost(BaseIT.readHost());
  conf.setPort("String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  VerdictContext vc=VerdictJDBCContext.from(conf);
  vc.executeJdbcQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  vc.destroy();
}
Program: 96100
Project: 96100
Buggy source:
@Override public ExactRelation visitJoin_part(VerdictSQLParser.Join_partContext ctx){
  if (ctx.INNER() != null) {
    TableSourceExtractor ext=new TableSourceExtractor();
    ExactRelation r=ext.visit(ctx.table_source());
    Cond cond=Cond.from(vc,ctx.search_condition());
    ColNameResolver resolver=new ColNameResolver(tableAliasAndColNames);
    Cond resolved=resolver.visit(cond);
    if (resolved instanceof CompCond) {
      CompCond comp=(CompCond)resolved;
      Expr right=comp.getRight();
      if (right instanceof ColNameExpr) {
        if (((ColNameExpr)right).getCol() != r.getAlias()) {
          resolved=new CompCond(comp.getRight(),comp.getOp(),comp.getLeft());
        }
      }
    }
    joinCond=resolved;
    return r;
  }
 else {
    VerdictLogger.error(this,"String_Node_Str" + ctx.getText());
    return null;
  }
}

Fixed version (ground truth):
@Override public ExactRelation visitJoin_part(VerdictSQLParser.Join_partContext ctx){
  if (ctx.INNER() != null) {
    TableSourceExtractor ext=new TableSourceExtractor();
    ExactRelation r=ext.visit(ctx.table_source());
    Cond cond=Cond.from(vc,ctx.search_condition());
    ColNameResolver resolver=new ColNameResolver(tableAliasAndColNames);
    Cond resolved=resolver.visit(cond);
    if (resolved instanceof CompCond) {
      CompCond comp=(CompCond)resolved;
      Expr right=comp.getRight();
      if (right instanceof ColNameExpr) {
        if (((ColNameExpr)right).getTab() != r.getAlias()) {
          resolved=new CompCond(comp.getRight(),comp.getOp(),comp.getLeft());
        }
      }
    }
    joinCond=resolved;
    return r;
  }
 else {
    VerdictLogger.error(this,"String_Node_Str" + ctx.getText());
    return null;
  }
}
Program: 96101
Project: 96101
Buggy source:
@Override public Map<String,String> getColumns(TableUniqueName table) throws VerdictException {
  Map<String,String> col2type=new LinkedHashMap<String,String>();
  List<Row> rows=executeSparkQuery("String_Node_Str" + table).collectAsList();
  for (  Row row : rows) {
    String column=row.getString(0);
    String type=row.getString(2);
    col2type.put(column,type);
  }
  return col2type;
}

Fixed version (ground truth):
@Override public Map<String,String> getColumns(TableUniqueName table) throws VerdictException {
  Map<String,String> col2type=new LinkedHashMap<String,String>();
  List<Row> rows=executeSparkQuery("String_Node_Str" + table).collectAsList();
  for (  Row row : rows) {
    String column=row.getString(0);
    String type=row.getString(1);
    col2type.put(column,type);
  }
  return col2type;
}
Program: 96102
Project: 96102
Buggy source:
@Override protected void testGroupbyCountFor(String tableName,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).count().orderby(groups).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}

Fixed version (ground truth):
@Override protected void testGroupbyCountFor(String tableName,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).count().orderby(groups).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}
Program: 96103
Project: 96103
Buggy source:
@Override protected void testSimpleAvgFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.avg(aggCol).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}

Fixed version (ground truth):
@Override protected void testSimpleAvgFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.avg(aggCol).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}
Program: 96104
Project: 96104
Buggy source:
@Override protected void testGroupbyAvgFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).avg(aggCol).orderby(groups).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}

Fixed version (ground truth):
@Override protected void testGroupbyAvgFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).avg(aggCol).orderby(groups).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}
Program: 96105
Project: 96105
Buggy source:
@Override protected void testSimpleCountFor(String tableName,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.count().collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}

Fixed version (ground truth):
@Override protected void testSimpleCountFor(String tableName,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.count().collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}
Program: 96106
Project: 96106
Buggy source:
@Override protected void testGroupbyCountDistinctFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).countDistinct(aggCol).orderby(groups).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}

Fixed version (ground truth):
@Override protected void testGroupbyCountDistinctFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).countDistinct(aggCol).orderby(groups).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}
Program: 96107
Project: 96107
Buggy source:
@Override protected void testSimpleCountDistinctFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.countDistinct(aggCol).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}

Fixed version (ground truth):
@Override protected void testSimpleCountDistinctFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.countDistinct(aggCol).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}
Program: 96108
Project: 96108
Buggy source:
@Override protected void testSimpleSumFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.sum(aggCol).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}

Fixed version (ground truth):
@Override protected void testSimpleSumFor(String tableName,String aggCol,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String sql=String.format("String_Node_Str",aggCol,tableName);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.sum(aggCol).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsSimilar(expected,actual,1,error);
}
Program: 96109
Project: 96109
Buggy source:
@Override protected void testGroupbySumFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).sum(aggCol).orderby(groups).collectResultSet());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}

Fixed version (ground truth):
@Override protected void testGroupbySumFor(String tableName,String aggCol,List<String> groupby,String sampleType,List<String> sampleColumns) throws SQLException, VerdictException {
  String groups=Joiner.on("String_Node_Str").join(groupby);
  String sql=String.format("String_Node_Str",groups,aggCol,tableName,groups,groups);
  List<List<Object>> expected=collectResult(hc.sql(sql));
  TableUniqueName originalTable=TableUniqueName.uname(vc,tableName);
  ApproxRelation r=ApproxSingleRelation.from(vc,new SampleParam(vc,originalTable,sampleType,samplingRatio,sampleColumns));
  List<List<Object>> actual=collectResult(r.groupby(groups).sum(aggCol).orderby(groups).collectDataFrame());
  printTestCase(sql,expected,actual);
  assertColsEqual(expected,actual,1);
  assertColsSimilar(expected,actual,2,error);
}
Program: 96110
Project: 96110
Buggy source:
private TableUniqueName createTableWithRandNumbers(SampleParam param) throws VerdictException {
  ExactRelation withRand=SingleRelation.from(vc,param.originalTable).select("String_Node_Str");
  TableUniqueName temp=Relation.getTempTableName(vc,param.sampleTableName().getSchemaName());
  String sql=String.format("String_Node_Str",temp,withRand.toSql());
  executeUpdate(sql);
  return temp;
}

Fixed version (ground truth):
private TableUniqueName createTableWithRandNumbers(SampleParam param) throws VerdictException {
  ExactRelation withRand=SingleRelation.from(vc,param.originalTable).select("String_Node_Str");
  TableUniqueName temp=Relation.getTempTableName(vc,param.sampleTableName().getSchemaName());
  String sql=String.format("String_Node_Str",temp,withRand.toSql());
  VerdictLogger.debug(this,"String_Node_Str");
  VerdictLogger.debugPretty(this,Relation.prettyfySql(sql),"String_Node_Str");
  executeUpdate(sql);
  return temp;
}
Program: 96111
Project: 96111
Buggy source:
private void createUniformRandomSampleFromRandTable(SampleParam param,TableUniqueName temp) throws VerdictException {
  String samplingProbCol=vc.getDbms().samplingProbabilityColumnName();
  Set<String> colNames=vc.getMeta().getColumns(param.originalTable);
  ExactRelation withRand=SingleRelation.from(vc,temp);
  long total_size=withRand.countValue();
  ExactRelation sampled=withRand.select(Joiner.on("String_Node_Str").join(colNames) + "String_Node_Str" + total_size+ "String_Node_Str"+ samplingProbCol+ "String_Node_Str"+ randomPartitionColumn());
  String sql=String.format("String_Node_Str",param.sampleTableName() + sampled.toSql());
  VerdictLogger.debug(this,"String_Node_Str");
  VerdictLogger.debugPretty(this,Relation.prettyfySql(sql),"String_Node_Str");
  executeUpdate(sql);
}

Fixed version (ground truth):
private void createUniformRandomSampleFromRandTable(SampleParam param,TableUniqueName temp) throws VerdictException {
  String samplingProbCol=vc.getDbms().samplingProbabilityColumnName();
  Set<String> colNames=vc.getMeta().getColumns(param.originalTable);
  ExactRelation withRand=SingleRelation.from(vc,temp);
  long total_size=withRand.countValue();
  ExactRelation sampled=withRand.where("String_Node_Str" + param.samplingRatio).select(Joiner.on("String_Node_Str").join(colNames) + "String_Node_Str" + total_size+ "String_Node_Str"+ samplingProbCol+ "String_Node_Str"+ randomPartitionColumn());
  String sql=String.format("String_Node_Str",param.sampleTableName(),sampled.toSql());
  VerdictLogger.debug(this,"String_Node_Str");
  VerdictLogger.debugPretty(this,Relation.prettyfySql(sql),"String_Node_Str");
  executeUpdate(sql);
}
Program: 96112
Project: 96112
Buggy source:
@Override protected Map<TableUniqueName,String> tableSubstitution(){
  return ImmutableMap.of();
}

Fixed version (ground truth):
@Override protected Map<TableUniqueName,String> tableSubstitution(){
  return source.tableSubstitution();
}
Program: 96115
Project: 96115
Buggy source:
@Override protected Map<TableUniqueName,String> tableSubstitution(){
  return source.tableSubstitution();
}

Fixed version (ground truth):
/** 
 * Due to the fact that the antecedents of a projected relation does not propagate any substitution.
 */
@Override protected Map<TableUniqueName,String> tableSubstitution(){
  return ImmutableMap.of();
}