Expression func = super.visitLeave(node,children);
// this need not be done for group by clause with array. Hence the below check
if (!statement.isAggregate() && ArrayIndexFunction.NAME.equals(node.getName())) {
final List<KeyValueColumnExpression> indexKVs = Lists.newArrayList();
// Create anon visitor to find reference to array in a generic way
children.get(0).accept(new KeyValueExpressionVisitor() {
@Override
public Void visit(KeyValueColumnExpression expression) {
if (expression.getDataType().isArrayType()) {
indexKVs.add(expression);
}