Tabnine Logo
RelMdUtil.areColumnsDefinitelyUnique
Code IndexAdd Tabnine to your IDE (free)

How to use
areColumnsDefinitelyUnique
method
in
org.apache.calcite.rel.metadata.RelMdUtil

Best Java code snippets using org.apache.calcite.rel.metadata.RelMdUtil.areColumnsDefinitelyUnique (Showing top 13 results out of 315)

origin: apache/hive

if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
origin: Qihoo360/Quicksql

 /** Catch-all implementation for
  * {@link BuiltInMetadata.PopulationSize#getPopulationSize(ImmutableBitSet)},
  * invoked using reflection.
  *
  * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getPopulationSize(RelNode, ImmutableBitSet)
  */
 public Double getPopulationSize(RelNode rel, RelMetadataQuery mq,
   ImmutableBitSet groupKey) {
  // if the keys are unique, return the row count; otherwise, we have
  // no further information on which to return any legitimate value

  // REVIEW zfong 4/11/06 - Broadbase code returns the product of each
  // unique key, which would result in the population being larger
  // than the total rows in the relnode
  boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey);
  if (uniq) {
   return mq.getRowCount(rel);
  }

  return null;
 }
}
origin: apache/drill

if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
origin: org.apache.calcite/calcite-core

 /** Catch-all implementation for
  * {@link BuiltInMetadata.PopulationSize#getPopulationSize(ImmutableBitSet)},
  * invoked using reflection.
  *
  * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getPopulationSize(RelNode, ImmutableBitSet)
  */
 public Double getPopulationSize(RelNode rel, RelMetadataQuery mq,
   ImmutableBitSet groupKey) {
  // if the keys are unique, return the row count; otherwise, we have
  // no further information on which to return any legitimate value

  // REVIEW zfong 4/11/06 - Broadbase code returns the product of each
  // unique key, which would result in the population being larger
  // than the total rows in the relnode
  boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey);
  if (uniq) {
   return mq.getRowCount(rel);
  }

  return null;
 }
}
origin: Qihoo360/Quicksql

if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
 SQL2REL_LOGGER.debug("There are no unique keys for {}", left);
 return;
origin: Qihoo360/Quicksql

/** Catch-all implementation for
 * {@link BuiltInMetadata.DistinctRowCount#getDistinctRowCount(ImmutableBitSet, RexNode)},
 * invoked using reflection.
 *
 * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getDistinctRowCount(RelNode, ImmutableBitSet, RexNode)
 */
public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey, RexNode predicate) {
 // REVIEW zfong 4/19/06 - Broadbase code does not take into
 // consideration selectivity of predicates passed in.  Also, they
 // assume the rows are unique even if the table is not
 boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey);
 if (uniq) {
  return NumberUtil.multiply(mq.getRowCount(rel),
    mq.getSelectivity(rel, predicate));
 }
 return null;
}
origin: org.apache.calcite/calcite-core

if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
 SQL2REL_LOGGER.debug("There are no unique keys for {}", left);
 return;
origin: org.apache.calcite/calcite-core

/** Catch-all implementation for
 * {@link BuiltInMetadata.DistinctRowCount#getDistinctRowCount(ImmutableBitSet, RexNode)},
 * invoked using reflection.
 *
 * @see org.apache.calcite.rel.metadata.RelMetadataQuery#getDistinctRowCount(RelNode, ImmutableBitSet, RexNode)
 */
public Double getDistinctRowCount(RelNode rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey, RexNode predicate) {
 // REVIEW zfong 4/19/06 - Broadbase code does not take into
 // consideration selectivity of predicates passed in.  Also, they
 // assume the rows are unique even if the table is not
 boolean uniq = RelMdUtil.areColumnsDefinitelyUnique(mq, rel, groupKey);
 if (uniq) {
  return NumberUtil.multiply(mq.getRowCount(rel),
    mq.getSelectivity(rel, predicate));
 }
 return null;
}
origin: com.alibaba.blink/flink-table

if (!RelMdUtil.areColumnsDefinitelyUnique(mq, left, allCols)) {
  SQL2REL_LOGGER.debug("There are no unique keys for {}", left);
  return;
origin: org.apache.calcite/calcite-core

 && !RelMdUtil.areColumnsDefinitelyUnique(
   mq, join.getRight(), joinInfo.rightSet())) {
return false;
 && !RelMdUtil.areColumnsDefinitelyUnique(
   mq, join.getLeft(), joinInfo.leftSet())) {
return false;
origin: Qihoo360/Quicksql

 && !RelMdUtil.areColumnsDefinitelyUnique(
   mq, join.getRight(), joinInfo.rightSet())) {
return false;
 && !RelMdUtil.areColumnsDefinitelyUnique(
   mq, join.getLeft(), joinInfo.leftSet())) {
return false;
origin: Qihoo360/Quicksql

for (RelNode input : union.getInputs()) {
 boolean alreadyUnique =
   RelMdUtil.areColumnsDefinitelyUnique(mq, input,
     aggRel.getGroupSet());
origin: org.apache.calcite/calcite-core

for (RelNode input : union.getInputs()) {
 boolean alreadyUnique =
   RelMdUtil.areColumnsDefinitelyUnique(mq, input,
     aggRel.getGroupSet());
org.apache.calcite.rel.metadataRelMdUtilareColumnsDefinitelyUnique

Javadoc

Returns true if the columns represented in a bit mask are definitely known to form a unique column set.

Popular methods of RelMdUtil

  • guessSelectivity
    Returns default estimates for selectivities, in the absence of stats.
  • areColumnsDefinitelyUniqueWhenNullsFiltered
    Returns true if the columns represented in a bit mask are definitely known to form a unique column s
  • getJoinDistinctRowCount
    Computes the number of distinct rows for a set of keys returned from a join. Also known as NDV (numb
  • minusPreds
    Takes the difference between two predicates, removing from the first any predicates also in the seco
  • estimateFilteredRows
  • linear
    Returns a point on a line.The result is always a value between minY and maxY, even if x is not betwe
  • getJoinRowCount
    Returns an estimate of the number of rows returned by a Join.
  • areColumnsUnique
  • areColumnsUniqueWhenNullsFiltered
  • capInfinity
    Caps a double value at Double.MAX_VALUE if it's currently infinity
  • cardOfProjExpr
    Computes the cardinality of a particular expression from the projection list.
  • checkInputForCollationAndLimit
    Returns whether a relational expression is already sorted and has fewer rows than the sum of offset
  • cardOfProjExpr,
  • checkInputForCollationAndLimit,
  • computeSemiJoinSelectivity,
  • getJoinPopulationSize,
  • getMinusRowCount,
  • getSelectivityValue,
  • getSemiJoinRowCount,
  • getUnionAllRowCount,
  • makeSemiJoinSelectivityRexNode

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now