Program: 95909
Project: 95909
Buggy source:
/** 
 * Computes three nodes. They compute: (1) 0.1% and 99.9% percentiles of numeric columns and the total count, (for this, we compute standard deviations and estimate those percentiles based on the standard deviations and normal distribution assumptions. \pm 3.09 * stddev is the 99.9 and 0.1 percentiles of the standard normal distribution.) (2) the list of "large" groups, and (3) the sizes of "large" groups <p>Recall that channels 100 and 101 are reserved for column meta and partition meta, respectively. <p>This method generates up to three nodes, and the token keys set up by those nodes are: 1. queryResult: this contains avg, std, and count 2. schemaName, tableName: this is the name of the temporary tables that contains a list of large groups. 3. queryResult: this contains the sum of the sizes of large groups.
 */
@Override public List<ExecutableNodeBase> getStatisticsNode(String oldSchemaName,String oldTableName,String columnMetaTokenKey,String partitionMetaTokenKey){
  List<ExecutableNodeBase> statisticsNodes=new ArrayList<>();
  PercentilesAndCountNode pc=new PercentilesAndCountNode(oldSchemaName,oldTableName,columnMetaTokenKey,partitionMetaTokenKey,primaryColumnName);
  statisticsNodes.add(pc);
  OutlierProportionNode op=new OutlierProportionNode(oldSchemaName,oldTableName);
  op.subscribeTo(pc);
  statisticsNodes.add(op);
  if (primaryColumnName.isPresent()) {
    TempIdCreatorInScratchpadSchema idCreator=new TempIdCreatorInScratchpadSchema(scratchpadSchemaName);
    LargeGroupListNode ll=new LargeGroupListNode(idCreator,oldSchemaName,oldTableName,primaryColumnName.get(),blockSize);
    ll.subscribeTo(pc,0);
    LargeGroupSizeNode ls=new LargeGroupSizeNode(primaryColumnName.get());
    ls.subscribeTo(ll,0);
    statisticsNodes.add(ll);
    statisticsNodes.add(ls);
  }
  return statisticsNodes;
}

Fixed version (ground truth):
/** 
 * Computes three nodes. They compute: (1) 0.1% and 99.9% percentiles of numeric columns and the total count, (for this, we compute standard deviations and estimate those percentiles based on the standard deviations and normal distribution assumptions. \pm 3.09 * stddev is the 99.9 and 0.1 percentiles of the standard normal distribution.) (2) the list of "large" groups, and (3) the sizes of "large" groups <p>Recall that channels 100 and 101 are reserved for column meta and partition meta, respectively. <p>This method generates up to three nodes, and the token keys set up by those nodes are: 1. queryResult: this contains avg, std, and count 2. schemaName, tableName: this is the name of the temporary tables that contains a list of large groups. 3. queryResult: this contains the sum of the sizes of large groups.
 */
@Override public List<ExecutableNodeBase> getStatisticsNode(String oldSchemaName,String oldTableName,String columnMetaTokenKey,String partitionMetaTokenKey){
  List<ExecutableNodeBase> statisticsNodes=new ArrayList<>();
  PercentilesAndCountNode pc=new PercentilesAndCountNode(oldSchemaName,oldTableName,columnMetaTokenKey,partitionMetaTokenKey,primaryColumnName);
  statisticsNodes.add(pc);
  OutlierProportionNode op=new OutlierProportionNode(oldSchemaName,oldTableName);
  op.subscribeTo(pc);
  statisticsNodes.add(op);
  if (primaryColumnName.isPresent()) {
    TempIdCreatorInScratchpadSchema idCreator=new TempIdCreatorInScratchpadSchema(scratchpadSchemaName);
    LargeGroupListNode ll=new LargeGroupListNode(idCreator,oldSchemaName,oldTableName,primaryColumnName.get(),blockSize);
    ll.subscribeTo(pc,0);
    LargeGroupSizeNode ls=new LargeGroupSizeNode(primaryColumnName.get());
    ll.registerSubscriber(ls.getSubscriptionTicket());
    statisticsNodes.add(ll);
    statisticsNodes.add(ls);
  }
  return statisticsNodes;
}