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

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

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

origin: apache/hive

/**
 *
 * @param j
 * @param additionalPredicate
 * @return if predicate is the join condition return (true, joinCond)
 * else return (false, minusPred)
 */
private Pair<Boolean,RexNode> getCombinedPredicateForJoin(Join j, RexNode additionalPredicate) {
 RexNode minusPred = RelMdUtil.minusPreds(j.getCluster().getRexBuilder(), additionalPredicate,
   j.getCondition());
 if (minusPred != null) {
  List<RexNode> minusList = new ArrayList<RexNode>();
  minusList.add(j.getCondition());
  minusList.add(minusPred);
  return new Pair<Boolean,RexNode>(false, minusPred);
 }
 return new Pair<Boolean,RexNode>(true,j.getCondition());
}
origin: apache/drill

/**
 *
 * @param j
 * @param additionalPredicate
 * @return if predicate is the join condition return (true, joinCond)
 * else return (false, minusPred)
 */
private Pair<Boolean,RexNode> getCombinedPredicateForJoin(Join j, RexNode additionalPredicate) {
 RexNode minusPred = RelMdUtil.minusPreds(j.getCluster().getRexBuilder(), additionalPredicate,
   j.getCondition());
 if (minusPred != null) {
  List<RexNode> minusList = new ArrayList<RexNode>();
  minusList.add(j.getCondition());
  minusList.add(minusPred);
  return new Pair<Boolean,RexNode>(false, minusPred);
 }
 return new Pair<Boolean,RexNode>(true,j.getCondition());
}
origin: com.facebook.presto.hive/hive-apache

/**
 * 
 * @param j
 * @param additionalPredicate
 * @return if predicate is the join condition return (true, joinCond)
 * else return (false, minusPred)
 */
private Pair<Boolean,RexNode> getCombinedPredicateForJoin(HiveJoin j, RexNode additionalPredicate) {
 RexNode minusPred = RelMdUtil.minusPreds(j.getCluster().getRexBuilder(), additionalPredicate,
   j.getCondition());
 if (minusPred != null) {
  List<RexNode> minusList = new ArrayList<RexNode>();
  minusList.add(j.getCondition());
  minusList.add(minusPred);
  return new Pair<Boolean,RexNode>(false, minusPred);
 }
 return new Pair<Boolean,RexNode>(true,j.getCondition());
}
origin: org.apache.calcite/calcite-core

public Double getSelectivity(Filter rel, RelMetadataQuery mq,
  RexNode predicate) {
 // Take the difference between the predicate passed in and the
 // predicate in the filter's condition, so we don't apply the
 // selectivity of the filter twice.  If no predicate is passed in,
 // use the filter's condition.
 if (predicate != null) {
  return mq.getSelectivity(rel.getInput(),
    RelMdUtil.minusPreds(
      rel.getCluster().getRexBuilder(),
      predicate,
      rel.getCondition()));
 } else {
  return mq.getSelectivity(rel.getInput(), rel.getCondition());
 }
}
origin: Qihoo360/Quicksql

public Double getSelectivity(Filter rel, RelMetadataQuery mq,
  RexNode predicate) {
 // Take the difference between the predicate passed in and the
 // predicate in the filter's condition, so we don't apply the
 // selectivity of the filter twice.  If no predicate is passed in,
 // use the filter's condition.
 if (predicate != null) {
  return mq.getSelectivity(rel.getInput(),
    RelMdUtil.minusPreds(
      rel.getCluster().getRexBuilder(),
      predicate,
      rel.getCondition()));
 } else {
  return mq.getSelectivity(rel.getInput(), rel.getCondition());
 }
}
org.apache.calcite.rel.metadataRelMdUtilminusPreds

Javadoc

Takes the difference between two predicates, removing from the first any predicates also in the second

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
  • 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

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top Sublime Text 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