private Long extractRowCount(RexInputRef ref) {
      RelColumnOrigin columnOrigin = this.metadataProvider.getColumnOrigin(filterOp, ref.getIndex());
      if (columnOrigin != null) {
        RelOptHiveTable table = (RelOptHiveTable) columnOrigin.getOriginTable();
        if (table != null) {
          if (StatsUtils.areBasicStatsUptoDateForQueryAnswering(table.getHiveTableMD(),
              table.getHiveTableMD().getParameters())) {
            return StatsUtils.getNumRows(table.getHiveTableMD());
          }
        }
      }
      return null;
    }
Replaces expressions with their reductions. Note that we only have to
look for RexCall, since nothing else is reducible in the first place.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsWithStatsRule.java