}
@Override
public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
Object... nodeOutputs) {
GroupByOperator op = (GroupByOperator)nd;
TableAccessCtx tableAccessCtx = (TableAccessCtx)procCtx;
// Get the key column names, and check if the keys are all constants
// or columns (not expressions). If yes, proceed.
List<String> keyColNames =
TableAccessAnalyzer.getKeyColNames(op.getConf().getKeys());
if (keyColNames == null) {
// we are done, since there are no keys to check for
return null;
}
// Walk the operator tree to the TableScan and build the mapping
// along the way for the columns that the group by uses as keys
TableScanOperator tso = TableAccessAnalyzer.genRootTableScan(
op.getParentOperators().get(0), keyColNames);
if (tso == null) {
// Could not find an allowed path to a table scan operator,
// hence we are done
return null;