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

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

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

origin: Qihoo360/Quicksql

Double rowCount = mq.getRowCount(rel);
if (call.isA(SqlKind.MINUS_PREFIX)) {
 distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
} else if (call.isA(ImmutableList.of(SqlKind.PLUS, SqlKind.MINUS))) {
 Double card0 = cardOfProjExpr(mq, rel, call.getOperands().get(0));
 if (card0 == null) {
  return null;
 Double card1 = cardOfProjExpr(mq, rel, call.getOperands().get(1));
 if (card1 == null) {
  return null;
 distinctRowCount =
   NumberUtil.multiply(
     cardOfProjExpr(mq, rel, call.getOperands().get(0)),
     cardOfProjExpr(mq, rel, call.getOperands().get(1)));
  distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
 } else {
  distinctRowCount = rowCount / 10;
origin: org.apache.calcite/calcite-core

Double rowCount = mq.getRowCount(rel);
if (call.isA(SqlKind.MINUS_PREFIX)) {
 distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
} else if (call.isA(ImmutableList.of(SqlKind.PLUS, SqlKind.MINUS))) {
 Double card0 = cardOfProjExpr(mq, rel, call.getOperands().get(0));
 if (card0 == null) {
  return null;
 Double card1 = cardOfProjExpr(mq, rel, call.getOperands().get(1));
 if (card1 == null) {
  return null;
 distinctRowCount =
   NumberUtil.multiply(
     cardOfProjExpr(mq, rel, call.getOperands().get(0)),
     cardOfProjExpr(mq, rel, call.getOperands().get(1)));
  distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
 } else {
  distinctRowCount = rowCount / 10;
origin: Qihoo360/Quicksql

public Double getPopulationSize(Project rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey) {
 ImmutableBitSet.Builder baseCols = ImmutableBitSet.builder();
 ImmutableBitSet.Builder projCols = ImmutableBitSet.builder();
 List<RexNode> projExprs = rel.getProjects();
 RelMdUtil.splitCols(projExprs, groupKey, baseCols, projCols);
 Double population =
   mq.getPopulationSize(rel.getInput(), baseCols.build());
 if (population == null) {
  return null;
 }
 // No further computation required if the projection expressions are
 // all column references
 if (projCols.cardinality() == 0) {
  return population;
 }
 for (int bit : projCols.build()) {
  Double subRowCount =
    RelMdUtil.cardOfProjExpr(mq, rel, projExprs.get(bit));
  if (subRowCount == null) {
   return null;
  }
  population *= subRowCount;
 }
 // REVIEW zfong 6/22/06 - Broadbase did not have the call to
 // numDistinctVals.  This is needed; otherwise, population can be
 // larger than the number of rows in the RelNode.
 return RelMdUtil.numDistinctVals(population, mq.getRowCount(rel));
}
origin: org.apache.calcite/calcite-core

public Double getPopulationSize(Project rel, RelMetadataQuery mq,
  ImmutableBitSet groupKey) {
 ImmutableBitSet.Builder baseCols = ImmutableBitSet.builder();
 ImmutableBitSet.Builder projCols = ImmutableBitSet.builder();
 List<RexNode> projExprs = rel.getProjects();
 RelMdUtil.splitCols(projExprs, groupKey, baseCols, projCols);
 Double population =
   mq.getPopulationSize(rel.getInput(), baseCols.build());
 if (population == null) {
  return null;
 }
 // No further computation required if the projection expressions are
 // all column references
 if (projCols.cardinality() == 0) {
  return population;
 }
 for (int bit : projCols.build()) {
  Double subRowCount =
    RelMdUtil.cardOfProjExpr(mq, rel, projExprs.get(bit));
  if (subRowCount == null) {
   return null;
  }
  population *= subRowCount;
 }
 // REVIEW zfong 6/22/06 - Broadbase did not have the call to
 // numDistinctVals.  This is needed; otherwise, population can be
 // larger than the number of rows in the RelNode.
 return RelMdUtil.numDistinctVals(population, mq.getRowCount(rel));
}
origin: org.apache.calcite/calcite-core

  RelMdUtil.cardOfProjExpr(mq, rel, projExprs.get(bit));
if (subRowCount == null) {
 return null;
origin: Qihoo360/Quicksql

  RelMdUtil.cardOfProjExpr(mq, rel, projExprs.get(bit));
if (subRowCount == null) {
 return null;
org.apache.calcite.rel.metadataRelMdUtilcardOfProjExpr

Javadoc

Computes the cardinality of a particular expression from the projection list.

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
  • 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
  • checkInputForCollationAndLimit
    Returns whether a relational expression is already sorted and has fewer rows than the sum of offset
  • capInfinity,
  • checkInputForCollationAndLimit,
  • computeSemiJoinSelectivity,
  • getJoinPopulationSize,
  • getMinusRowCount,
  • getSelectivityValue,
  • getSemiJoinRowCount,
  • getUnionAllRowCount,
  • makeSemiJoinSelectivityRexNode

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Permission (java.security)
    Legacy security code; do not use.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Github Copilot alternatives
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