private void addToGBExpr(RowResolver groupByOutputRowResolver,
        RowResolver groupByInputRowResolver, ASTNode grpbyExpr, RexNode grpbyExprNDesc,
        List<RexNode> gbExprNDescLst, List<String> outputColumnNames) {
      int i = gbExprNDescLst.size();
      String field = SemanticAnalyzer.getColumnInternalName(i);
      outputColumnNames.add(field);
      gbExprNDescLst.add(grpbyExprNDesc);

      ColumnInfo oColInfo = new ColumnInfo(field, TypeConverter.convert(grpbyExprNDesc.getType()), null, false);
      groupByOutputRowResolver.putExpression(grpbyExpr, oColInfo);

      addAlternateGByKeyMappings(grpbyExpr, oColInfo, groupByInputRowResolver,
          groupByOutputRowResolver);
    }
This method creates a HiveFilter containing a filter expression to enforce constraints.
Constraints to check: not null, check
The return value is the pair of Constraint HiveFilter and the corresponding RowResolver
or null if the target has no constraint defined or all of them are disabled.
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java