@SuppressWarnings("unchecked")
public List<Tuple> calculateGroupByProjection() throws ParseException{
	List<Tuple> new_tlist=new ArrayList<Tuple>();
	StringBuilder sb=new StringBuilder();

	selectList = select.getSelectItems();
	List<Tuple> tlist=instream.get(0);

	for(SelectExpressionItem s : selectList ){

		String col=new String();
		Expression exp=s.getExpression();

		ExpressionEvaluator ee=new ExpressionEvaluator();
		exp.accept(ee);

		if(ee.getUserColumn()!=null)
			col=ee.getUserColumn().getColumnName().toString();
		else
			col=ee.getColumn().getColumnName().toString();

		if(col.contains("|")){

			String fnct=col.split("\\|")[0];
			String expn=col.split("\\|")[1];
			if(fnct.equalsIgnoreCase("COUNT")){

				sb.append(new Count(instream,expn).getCount()+"|");

			}else if(fnct.equalsIgnoreCase("SUM")){
				sb.append(new Sum(instream,expn).getSum()+"|");

			}else if(fnct.equalsIgnoreCase("AVG")){
				sb.append(new Avg(instream,expn).getAvg()+"|");
			}

		}else{

			for(Tuple t : tlist){
				String val=t.getColValue(col);
				if(val!=null){
					sb.append(val+"|");
					break;
				}
			}
		}

	}
	String t=sb.substring(0,sb.length()-1);
	Tuple tuple=new Tuple(OutputSchema.osTable,t);
	new_tlist.add(tuple);

	return new_tlist;
}