core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
/**
   * Returns the
   * {@link BuiltInMetadata.ColumnUniqueness#areColumnsUnique(org.apache.calcite.util.ImmutableBitSet, boolean)}
   * statistic.
   *
   * @param rel     the relational expression
   * @param columns column mask representing the subset of columns for which
   *                uniqueness will be determined
   * @return true or false depending on whether the columns are unique, or
   * null if not enough information is available to make that determination
   */


@param rel     the relational expression
@param columns column mask representing the subset of columns for which
uniqueness will be determined
@return true or false depending on whether the columns are unique, or
null if not enough information is available to make that determination
@param rel the relational expression @param columns column mask representing the subset of columns for which uniqueness will be determined @return true or false depending on whether the columns are unique or null if not enough information is available to make that determination
public static Boolean areColumnsUnique(RelNode rel, ImmutableBitSet columns) {
    final BuiltInMetadata.ColumnUniqueness metadata =
        rel.metadata(BuiltInMetadata.ColumnUniqueness.class);
    return metadata.areColumnsUnique(columns, false);
  }
public static Boolean areColumnsUnique ( RelNode rel , ImmutableBitSet columns ) { final BuiltInMetadata . ColumnUniqueness metadata = rel . metadata ( BuiltInMetadata . ColumnUniqueness . class ) ; return metadata . areColumnsUnique ( columns , false ) ; }
Returns the
 {@link BuiltInMetadata.ColumnUniqueness#areColumnsUnique(org.apache.calcite.util.ImmutableBitSet, boolean)}
 statistic.
Returns the { @link BuiltInMetadata . ColumnUniqueness#areColumnsUnique ( org . apache . calcite . util . ImmutableBitSet boolean ) } statistic .