public static ExprNodeDesc isConstantParameterInAggregationParameters(String internalName,
                                                                        List<ExprNodeDesc> reduceValues) {
    // only the pattern of "VALUE._col([0-9]+)" should be handled.

    String[] terms = internalName.split("\\.");
    if (terms.length != 2 || reduceValues == null) {
      return null;
    }

    if (Utilities.ReduceField.VALUE.toString().equals(terms[0])) {
      int pos = HiveConf.getPositionFromInternalName(terms[1]);
      if (pos >= 0 && pos < reduceValues.size()) {
        ExprNodeDesc reduceValue = reduceValues.get(pos);
        if (reduceValue != null) {
          if (reduceValue.getWritableObjectInspector() instanceof ConstantObjectInspector) {
            // this internalName represents a constant parameter in aggregation parameters
            return reduceValue;
          }
        }
      }
    }

    return null;
  }
Check if the given internalName represents a constant parameter in aggregation parameters
of an aggregation tree.
This method is only invoked when map-side aggregation is not involved. In this case,
every parameter in every aggregation tree should already have a corresponding ColumnInfo,
which is generated when the corresponding ReduceSinkOperator of the GroupByOperator being
generating is generated. If we find that this parameter is a constant parameter,
we will return the corresponding ExprNodeDesc in reduceValues, and we will not need to
use a new ExprNodeColumnDesc, which can not be treated as a constant parameter, for this
parameter (since the writableObjectInspector of a ExprNodeColumnDesc will not be
a instance of ConstantObjectInspector).

@param reduceValues
         value columns of the corresponding ReduceSinkOperator
@param internalName
         the internal name of this parameter
@return the ExprNodeDesc of the constant parameter if the given internalName represents
        a constant parameter; otherwise, return null
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java