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
   * @param ignoreNulls if true, ignore null values when determining column
   *                    uniqueness
   * @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
@param ignoreNulls if true, ignore null values when determining column
uniqueness
@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 @param ignoreNulls if true ignore null values when determining column uniqueness @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,
      boolean ignoreNulls) {
    final BuiltInMetadata.ColumnUniqueness metadata =
        rel.metadata(BuiltInMetadata.ColumnUniqueness.class);
    return metadata.areColumnsUnique(columns, ignoreNulls);
  }
public static Boolean areColumnsUnique ( RelNode rel , ImmutableBitSet columns , boolean ignoreNulls ) { final BuiltInMetadata . ColumnUniqueness metadata = rel . metadata ( BuiltInMetadata . ColumnUniqueness . class ) ; return metadata . areColumnsUnique ( columns , ignoreNulls ) ; }
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 .