public Boolean areColumnsUnique(HiveTableScan rel, RelMetadataQuery mq,
                                  ImmutableBitSet columns, boolean ignoreNulls) {
    if(ignoreNulls) {
      return rel.getTable().isKey(columns);
    } else {
      RelOptHiveTable tbl = (RelOptHiveTable)rel.getTable();
      return tbl.isNonNullableKey(columns);
    }
  }
HiveRelMdColumnUniqueness implements the ability to get unique keys for table scan op.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/HiveRelMdColumnUniqueness.java