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

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

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

origin: apache/hive

@Override
public Double getDistinctRowCount(Join rel, RelMetadataQuery mq, ImmutableBitSet groupKey,
  RexNode predicate) {
 if (rel instanceof HiveJoin) {
  HiveJoin hjRel = (HiveJoin) rel;
  //TODO: Improve this
  if (rel instanceof SemiJoin) {
   return mq.getDistinctRowCount(hjRel.getLeft(), groupKey,
     rel.getCluster().getRexBuilder().makeLiteral(true));
  } else {
   return RelMdUtil.getJoinDistinctRowCount(mq, rel, rel.getJoinType(),
     groupKey, predicate, true);
  }
 }
 return mq.getDistinctRowCount(rel, groupKey, predicate);
}
origin: apache/drill

@Override
public Double getDistinctRowCount(Join rel, RelMetadataQuery mq, ImmutableBitSet groupKey,
  RexNode predicate) {
 if (rel instanceof HiveJoin) {
  HiveJoin hjRel = (HiveJoin) rel;
  //TODO: Improve this
  if (rel instanceof SemiJoin) {
   return mq.getDistinctRowCount(hjRel.getLeft(), groupKey,
     rel.getCluster().getRexBuilder().makeLiteral(true));
  } else {
   return RelMdUtil.getJoinDistinctRowCount(mq, rel, rel.getJoinType(),
     groupKey, predicate, true);
  }
 }
 return mq.getDistinctRowCount(rel, groupKey, predicate);
}
origin: Qihoo360/Quicksql

public Double getDistinctRowCount(Join rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey, RexNode predicate) {
 if (predicate == null || predicate.isAlwaysTrue()) {
  if (groupKey.isEmpty()) {
   return 1D;
  }
 }
 return RelMdUtil.getJoinDistinctRowCount(mq, rel, rel.getJoinType(),
   groupKey, predicate, false);
}
origin: org.apache.calcite/calcite-core

public Double getDistinctRowCount(Join rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey, RexNode predicate) {
 if (predicate == null || predicate.isAlwaysTrue()) {
  if (groupKey.isEmpty()) {
   return 1D;
  }
 }
 return RelMdUtil.getJoinDistinctRowCount(mq, rel, rel.getJoinType(),
   groupKey, predicate, false);
}
origin: com.facebook.presto.hive/hive-apache

@Override
public Double getDistinctRowCount(Join rel, ImmutableBitSet groupKey,
  RexNode predicate) {
 if (rel instanceof HiveJoin) {
  HiveJoin hjRel = (HiveJoin) rel;
  //TODO: Improve this
  if (hjRel.isLeftSemiJoin()) {
   return RelMetadataQuery.getDistinctRowCount(hjRel.getLeft(), groupKey,
     rel.getCluster().getRexBuilder().makeLiteral(true));
  } else {
   return RelMdUtil.getJoinDistinctRowCount(rel, rel.getJoinType(),
     groupKey, predicate, true);
  }
 }
 return RelMetadataQuery.getDistinctRowCount(rel, groupKey, predicate);
}
org.apache.calcite.rel.metadataRelMdUtilgetJoinDistinctRowCount

Javadoc

Computes the number of distinct rows for a set of keys returned from a join. Also known as NDV (number of distinct values).

Popular methods of RelMdUtil

  • guessSelectivity
    Returns default estimates for selectivities, in the absence of stats.
  • areColumnsDefinitelyUnique
    Returns true if the columns represented in a bit mask are definitely known to form a unique column s
  • areColumnsDefinitelyUniqueWhenNullsFiltered
    Returns true if the columns represented in a bit mask are definitely known to form a unique column s
  • 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

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Best IntelliJ plugins
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