public static class GroupByRule implements NodeProcessor {
@Override
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
Object... nodeOutputs) throws SemanticException {
GroupByOperator gbyOp = (GroupByOperator)nd;
List<String> gbyKeys = new ArrayList<String>();
for (ExprNodeDesc exprDesc : gbyOp.getConf().getKeys()) {
for (Entry<String, ExprNodeDesc> entry : gbyOp.getColumnExprMap().entrySet()) {
if (exprDesc.isSame(entry.getValue())) {
gbyKeys.add(entry.getKey());
}
}
}
List<List<String>> listBucketCols = new ArrayList<List<String>>();
listBucketCols.add(gbyKeys);
OpTraits opTraits = new OpTraits(listBucketCols, -1, listBucketCols);
gbyOp.setOpTraits(opTraits);
return null;
}