public boolean needsMaskingOrFiltering(HivePrivilegeObject privObject)
      throws SemanticException {
    String filter = privObject.getRowFilterExpression();
    if (filter != null) {
      return true;
    }
    List<String> exprs = privObject.getCellValueTransformers();
    if (exprs != null) {
      if (exprs.size() != privObject.getColumns().size()) {
        throw new SemanticException("Expect " + privObject.getColumns().size() + " columns in "
            + privObject.getObjectName() + ", but only find " + exprs.size());
      }
      for (int index = 0; index < exprs.size(); index++) {
        String expr = exprs.get(index);
        if (expr == null) {
          throw new SemanticException("Expect string type CellValueTransformer in "
              + privObject.getObjectName() + ", but only find null");
        }
        String colName = privObject.getColumns().get(index);
        if (!expr.equals(colName)) {
          return true;
        }
      }
    }
    return false;
  }
The main purpose for this class is for authorization. More specifically, row
filtering and column masking are done through this class. We first call
create function to create the corresponding strings for row filtering and
column masking. We then replace the TAB_REF with the strings.
ql/src/java/org/apache/hadoop/hive/ql/parse/TableMask.java