blob: 5500859be98df086086daf338d2a98abbd4be95b [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>RelMdUtil (Apache Calcite API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.rel.metadata, class: RelMdUtil">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<div class="about-language"><b>Apache Calcite</b></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.rel.metadata</a></div>
<h1 title="Class RelMdUtil" class="title">Class RelMdUtil</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.calcite.rel.metadata.RelMdUtil</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">RelMdUtil</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">RelMdUtil provides utility methods used by the metadata provider methods.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final <a href="../../sql/SqlFunction.html" title="class in org.apache.calcite.sql">SqlFunction</a></code></div>
<div class="col-second even-row-color"><code><a href="#ARTIFICIAL_SELECTIVITY_FUNC" class="member-name-link">ARTIFICIAL_SELECTIVITY_FUNC</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#addEpsilon(double)" class="member-name-link">addEpsilon</a><wbr>(double&nbsp;d)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Add an epsilon to the value passed in.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsDefinitelyUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)" class="member-name-link">areColumnsDefinitelyUnique</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsDefinitelyUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)" class="member-name-link">areColumnsDefinitelyUnique</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;colMask)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if the columns represented in a bit mask are definitely
known to form a unique column set.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsDefinitelyUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)" class="member-name-link">areColumnsDefinitelyUniqueWhenNullsFiltered</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsDefinitelyUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)" class="member-name-link">areColumnsDefinitelyUniqueWhenNullsFiltered</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;colMask)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns true if the columns represented in a bit mask are definitely
known to form a unique column set, when nulls have been filtered from
the columns.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)" class="member-name-link">areColumnsUnique</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#areColumnsUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)" class="member-name-link">areColumnsUniqueWhenNullsFiltered</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#capInfinity(java.lang.Double)" class="member-name-link">capInfinity</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;d)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Caps a double value at Double.MAX_VALUE if it's currently infinity</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#cardOfProjExpr(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Project,org.apache.calcite.rex.RexNode)" class="member-name-link">cardOfProjExpr</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Project.html" title="class in org.apache.calcite.rel.core">Project</a>&nbsp;rel,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the cardinality of a particular expression from the projection
list.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#checkInputForCollationAndLimit(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelCollation,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)" class="member-name-link">checkInputForCollationAndLimit</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;input,
<a href="../RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&nbsp;collation,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;offset,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;fetch)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns whether a relational expression is already sorted and has fewer
rows than the sum of offset and limit.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#clearCache(org.apache.calcite.rel.RelNode)" class="member-name-link">clearCache</a><wbr>(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Removes cached metadata values for specified RelNode.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#computeSemiJoinSelectivity(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,java.util.List,java.util.List)" class="member-name-link">computeSemiJoinSelectivity</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;&nbsp;factKeyList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;&nbsp;dimKeyList)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the selectivity of a semijoin filter if it is applied on a fact
table.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#computeSemiJoinSelectivity(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.core.Join)" class="member-name-link">computeSemiJoinSelectivity</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;rel)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the selectivity of a semijoin filter if it is applied on a fact
table.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#estimateFilteredRows(org.apache.calcite.rel.RelNode,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.metadata.RelMetadataQuery)" class="member-name-link">estimateFilteredRows</a><wbr>(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;child,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#estimateFilteredRows(org.apache.calcite.rel.RelNode,org.apache.calcite.rex.RexProgram,org.apache.calcite.rel.metadata.RelMetadataQuery)" class="member-name-link">estimateFilteredRows</a><wbr>(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;child,
<a href="../../rex/RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getJoinDistinctRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.core.JoinRelType,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rex.RexNode,boolean)" class="member-name-link">getJoinDistinctRowCount</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;joinRel,
<a href="../core/JoinRelType.html" title="enum in org.apache.calcite.rel.core">JoinRelType</a>&nbsp;joinType,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate,
boolean&nbsp;useMaxNdv)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the number of distinct rows for a set of keys returned from a
join.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getJoinPopulationSize(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)" class="member-name-link">getJoinPopulationSize</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;join_,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the population size for a set of keys returned from a join.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getJoinRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Join,org.apache.calcite.rex.RexNode)" class="member-name-link">getJoinRowCount</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;join,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Join.html" title="class in org.apache.calcite.rel.core"><code>Join</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getMinusRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Minus)" class="member-name-link">getMinusRowCount</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Minus.html" title="class in org.apache.calcite.rel.core">Minus</a>&nbsp;minus)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Minus.html" title="class in org.apache.calcite.rel.core"><code>Minus</code></a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getSelectivityValue(org.apache.calcite.rex.RexNode)" class="member-name-link">getSelectivityValue</a><wbr>(<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;artificialSelectivityFuncNode)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the selectivity value stored in a call.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getSemiJoinDistinctRowCount(org.apache.calcite.rel.core.Join,org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rex.RexNode)" class="member-name-link">getSemiJoinDistinctRowCount</a><wbr>(<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;semiJoinRel,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Computes the number of distinct rows for a set of keys returned from a
semi-join.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getUnionAllRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Union)" class="member-name-link">getUnionAllRowCount</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Union.html" title="class in org.apache.calcite.rel.core">Union</a>&nbsp;rel)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Union.html" title="class in org.apache.calcite.rel.core"><code>Union</code></a>
(before duplicates are eliminated).</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#guessSelectivity(org.apache.calcite.rex.RexNode)" class="member-name-link">guessSelectivity</a><wbr>(@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns default estimates for selectivities, in the absence of stats.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#guessSelectivity(org.apache.calcite.rex.RexNode,boolean)" class="member-name-link">guessSelectivity</a><wbr>(@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate,
boolean&nbsp;artificialOnly)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns default estimates for selectivities, in the absence of stats.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#linear(int,int,int,double,double)" class="member-name-link">linear</a><wbr>(int&nbsp;x,
int&nbsp;minX,
int&nbsp;maxX,
double&nbsp;minY,
double&nbsp;maxY)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a point on a line.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#makeSemiJoinSelectivityRexNode(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Join)" class="member-name-link">makeSemiJoinSelectivityRexNode</a><wbr>(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;rel)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a RexNode that stores a selectivity value corresponding to the
selectivity of a semijoin.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#minusPreds(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)" class="member-name-link">minusPreds</a><wbr>(<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred1,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred2)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Takes the difference between two predicates, removing from the first any
predicates also in the second.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#numDistinctVals(java.lang.Double,java.lang.Double)" class="member-name-link">numDistinctVals</a><wbr>(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;domainSize,
@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;numSelected)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the number of distinct values provided numSelected are selected
where there are domainSize distinct values.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#setAggChildKeys(org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rel.core.Aggregate,org.apache.calcite.util.ImmutableBitSet.Builder)" class="member-name-link">setAggChildKeys</a><wbr>(<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../core/Aggregate.html" title="class in org.apache.calcite.rel.core">Aggregate</a>&nbsp;aggRel,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;childKey)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Takes a bitmap representing a set of input references and extracts the
ones that reference the group by columns in an aggregate.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#setLeftRightBitmaps(org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.util.ImmutableBitSet.Builder,org.apache.calcite.util.ImmutableBitSet.Builder,int)" class="member-name-link">setLeftRightBitmaps</a><wbr>(<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;leftMask,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;rightMask,
int&nbsp;nFieldsOnLeft)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Separates a bit-mask representing a join into masks representing the left
and right inputs into the join.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#splitCols(java.util.List,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.util.ImmutableBitSet.Builder,org.apache.calcite.util.ImmutableBitSet.Builder)" class="member-name-link">splitCols</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projExprs,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;baseCols,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;projCols)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Forms two bitmaps by splitting the columns in a bitmap according to
whether or not the column references the child input or is an expression.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#unionPreds(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)" class="member-name-link">unionPreds</a><wbr>(<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred1,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred2)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">AND's two predicates together, either of which may be null, removing
redundant filters.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#validatePercentage(java.lang.Double)" class="member-name-link">validatePercentage</a><wbr>(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;result)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Validates whether a value represents a percentage number
(that is, a value in the interval [0.0, 1.0]) and returns the value.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static @PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#validateResult(java.lang.Double)" class="member-name-link">validateResult</a><wbr>(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;result)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Validates the <code>result</code> is valid.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="ARTIFICIAL_SELECTIVITY_FUNC">
<h3>ARTIFICIAL_SELECTIVITY_FUNC</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type"><a href="../../sql/SqlFunction.html" title="class in org.apache.calcite.sql">SqlFunction</a></span>&nbsp;<span class="element-name">ARTIFICIAL_SELECTIVITY_FUNC</span></div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="makeSemiJoinSelectivityRexNode(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Join)">
<h3>makeSemiJoinSelectivityRexNode</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span>&nbsp;<span class="element-name">makeSemiJoinSelectivityRexNode</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;rel)</span></div>
<div class="block">Creates a RexNode that stores a selectivity value corresponding to the
selectivity of a semijoin. This can be added to a filter to simulate the
effect of the semijoin during costing, but should never appear in a real
plan since it has no physical implementation.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rel</code> - the semijoin of interest</dd>
<dt>Returns:</dt>
<dd>constructed rexnode</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSelectivityValue(org.apache.calcite.rex.RexNode)">
<h3>getSelectivityValue</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getSelectivityValue</span><wbr><span class="parameters">(<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;artificialSelectivityFuncNode)</span></div>
<div class="block">Returns the selectivity value stored in a call.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>artificialSelectivityFuncNode</code> - Call containing the selectivity value</dd>
<dt>Returns:</dt>
<dd>selectivity value</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="computeSemiJoinSelectivity(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.core.Join)">
<h3>computeSemiJoinSelectivity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">computeSemiJoinSelectivity</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;rel)</span></div>
<div class="block">Computes the selectivity of a semijoin filter if it is applied on a fact
table. The computation is based on the selectivity of the dimension
table/columns and the number of distinct values in the fact table
columns.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>factRel</code> - fact table participating in the semijoin</dd>
<dd><code>dimRel</code> - dimension table participating in the semijoin</dd>
<dd><code>rel</code> - semijoin rel</dd>
<dt>Returns:</dt>
<dd>calculated selectivity</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="computeSemiJoinSelectivity(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,java.util.List,java.util.List)">
<h3>computeSemiJoinSelectivity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">computeSemiJoinSelectivity</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;&nbsp;factKeyList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;&nbsp;dimKeyList)</span></div>
<div class="block">Computes the selectivity of a semijoin filter if it is applied on a fact
table. The computation is based on the selectivity of the dimension
table/columns and the number of distinct values in the fact table
columns.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>factRel</code> - fact table participating in the semijoin</dd>
<dd><code>dimRel</code> - dimension table participating in the semijoin</dd>
<dd><code>factKeyList</code> - LHS keys used in the filter</dd>
<dd><code>dimKeyList</code> - RHS keys used in the filter</dd>
<dt>Returns:</dt>
<dd>calculated selectivity</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="areColumnsDefinitelyUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)">
<h3>areColumnsDefinitelyUnique</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">areColumnsDefinitelyUnique</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;colMask)</span></div>
<div class="block">Returns true if the columns represented in a bit mask are definitely
known to form a unique column set.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rel</code> - the relational expression that the column mask corresponds
to</dd>
<dd><code>colMask</code> - bit mask containing columns that will be tested for
uniqueness</dd>
<dt>Returns:</dt>
<dd>true if bit mask represents a unique column set; false if not (or
if no metadata is available)</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="areColumnsUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)">
<h3>areColumnsUnique</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></span>&nbsp;<span class="element-name">areColumnsUnique</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</span></div>
</section>
</li>
<li>
<section class="detail" id="areColumnsDefinitelyUnique(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)">
<h3>areColumnsDefinitelyUnique</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">areColumnsDefinitelyUnique</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</span></div>
</section>
</li>
<li>
<section class="detail" id="areColumnsDefinitelyUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)">
<h3>areColumnsDefinitelyUniqueWhenNullsFiltered</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">areColumnsDefinitelyUniqueWhenNullsFiltered</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;colMask)</span></div>
<div class="block">Returns true if the columns represented in a bit mask are definitely
known to form a unique column set, when nulls have been filtered from
the columns.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rel</code> - the relational expression that the column mask corresponds
to</dd>
<dd><code>colMask</code> - bit mask containing columns that will be tested for
uniqueness</dd>
<dt>Returns:</dt>
<dd>true if bit mask represents a unique column set; false if not (or
if no metadata is available)</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="areColumnsUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)">
<h3>areColumnsUniqueWhenNullsFiltered</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link">Boolean</a></span>&nbsp;<span class="element-name">areColumnsUniqueWhenNullsFiltered</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</span></div>
</section>
</li>
<li>
<section class="detail" id="areColumnsDefinitelyUniqueWhenNullsFiltered(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,java.util.List)">
<h3>areColumnsDefinitelyUniqueWhenNullsFiltered</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">areColumnsDefinitelyUniqueWhenNullsFiltered</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexInputRef.html" title="class in org.apache.calcite.rex">RexInputRef</a>&gt;&nbsp;columnRefs)</span></div>
</section>
</li>
<li>
<section class="detail" id="setLeftRightBitmaps(org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.util.ImmutableBitSet.Builder,org.apache.calcite.util.ImmutableBitSet.Builder,int)">
<h3>setLeftRightBitmaps</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setLeftRightBitmaps</span><wbr><span class="parameters">(<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;leftMask,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;rightMask,
int&nbsp;nFieldsOnLeft)</span></div>
<div class="block">Separates a bit-mask representing a join into masks representing the left
and right inputs into the join.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>groupKey</code> - original bit-mask</dd>
<dd><code>leftMask</code> - left bit-mask to be set</dd>
<dd><code>rightMask</code> - right bit-mask to be set</dd>
<dd><code>nFieldsOnLeft</code> - number of fields in the left input</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="numDistinctVals(java.lang.Double,java.lang.Double)">
<h3>numDistinctVals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">numDistinctVals</span><wbr><span class="parameters">(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;domainSize,
@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;numSelected)</span></div>
<div class="block">Returns the number of distinct values provided numSelected are selected
where there are domainSize distinct values.
<p>Note that in the case where domainSize == numSelected, it's not true
that the return value should be domainSize. If you pick 100 random values
between 1 and 100, you'll most likely end up with fewer than 100 distinct
values, because you'll pick some values more than once.
<p>The implementation is an unbiased estimation of the number of distinct
values by performing a number of selections (with replacement) from a
universe set.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>domainSize</code> - Size of the universe set</dd>
<dd><code>numSelected</code> - The number of selections</dd>
<dt>Returns:</dt>
<dd>the expected number of distinct values, or null if either argument
is null</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="capInfinity(java.lang.Double)">
<h3>capInfinity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">capInfinity</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;d)</span></div>
<div class="block">Caps a double value at Double.MAX_VALUE if it's currently infinity</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>d</code> - the Double object</dd>
<dt>Returns:</dt>
<dd>the double value if it's not infinity; else Double.MAX_VALUE</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="guessSelectivity(org.apache.calcite.rex.RexNode)">
<h3>guessSelectivity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">guessSelectivity</span><wbr><span class="parameters">(@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate)</span></div>
<div class="block">Returns default estimates for selectivities, in the absence of stats.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>predicate</code> - predicate for which selectivity will be computed; null
means true, so gives selectity of 1.0</dd>
<dt>Returns:</dt>
<dd>estimated selectivity</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="guessSelectivity(org.apache.calcite.rex.RexNode,boolean)">
<h3>guessSelectivity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">guessSelectivity</span><wbr><span class="parameters">(@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate,
boolean&nbsp;artificialOnly)</span></div>
<div class="block">Returns default estimates for selectivities, in the absence of stats.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>predicate</code> - predicate for which selectivity will be computed;
null means true, so gives selectity of 1.0</dd>
<dd><code>artificialOnly</code> - return only the selectivity contribution from
artificial nodes</dd>
<dt>Returns:</dt>
<dd>estimated selectivity</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unionPreds(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)">
<h3>unionPreds</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span>&nbsp;<span class="element-name">unionPreds</span><wbr><span class="parameters">(<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred1,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred2)</span></div>
<div class="block">AND's two predicates together, either of which may be null, removing
redundant filters.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rexBuilder</code> - rexBuilder used to construct AND'd RexNode</dd>
<dd><code>pred1</code> - first predicate</dd>
<dd><code>pred2</code> - second predicate</dd>
<dt>Returns:</dt>
<dd>AND'd predicate or individual predicates if one is null</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="minusPreds(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)">
<h3>minusPreds</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span>&nbsp;<span class="element-name">minusPreds</span><wbr><span class="parameters">(<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred1,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;pred2)</span></div>
<div class="block">Takes the difference between two predicates, removing from the first any
predicates also in the second.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rexBuilder</code> - rexBuilder used to construct AND'd RexNode</dd>
<dd><code>pred1</code> - first predicate</dd>
<dd><code>pred2</code> - second predicate</dd>
<dt>Returns:</dt>
<dd>MINUS'd predicate list</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setAggChildKeys(org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rel.core.Aggregate,org.apache.calcite.util.ImmutableBitSet.Builder)">
<h3>setAggChildKeys</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setAggChildKeys</span><wbr><span class="parameters">(<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../core/Aggregate.html" title="class in org.apache.calcite.rel.core">Aggregate</a>&nbsp;aggRel,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;childKey)</span></div>
<div class="block">Takes a bitmap representing a set of input references and extracts the
ones that reference the group by columns in an aggregate.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>groupKey</code> - the original bitmap</dd>
<dd><code>aggRel</code> - the aggregate</dd>
<dd><code>childKey</code> - sets bits from groupKey corresponding to group by columns</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="splitCols(java.util.List,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.util.ImmutableBitSet.Builder,org.apache.calcite.util.ImmutableBitSet.Builder)">
<h3>splitCols</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">splitCols</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projExprs,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;baseCols,
<a href="../../util/ImmutableBitSet.Builder.html" title="class in org.apache.calcite.util">ImmutableBitSet.Builder</a>&nbsp;projCols)</span></div>
<div class="block">Forms two bitmaps by splitting the columns in a bitmap according to
whether or not the column references the child input or is an expression.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>projExprs</code> - Project expressions</dd>
<dd><code>groupKey</code> - Bitmap whose columns will be split</dd>
<dd><code>baseCols</code> - Bitmap representing columns from the child input</dd>
<dd><code>projCols</code> - Bitmap representing non-child columns</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="cardOfProjExpr(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Project,org.apache.calcite.rex.RexNode)">
<h3>cardOfProjExpr</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">cardOfProjExpr</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Project.html" title="class in org.apache.calcite.rel.core">Project</a>&nbsp;rel,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Computes the cardinality of a particular expression from the projection
list.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rel</code> - RelNode corresponding to the project</dd>
<dd><code>expr</code> - projection expression</dd>
<dt>Returns:</dt>
<dd>cardinality</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getJoinPopulationSize(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.util.ImmutableBitSet)">
<h3>getJoinPopulationSize</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">getJoinPopulationSize</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;join_,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey)</span></div>
<div class="block">Computes the population size for a set of keys returned from a join.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>join_</code> - Join relational operator</dd>
<dd><code>groupKey</code> - Keys to compute the population for</dd>
<dt>Returns:</dt>
<dd>computed population size</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addEpsilon(double)">
<h3>addEpsilon</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">addEpsilon</span><wbr><span class="parameters">(double&nbsp;d)</span></div>
<div class="block">Add an epsilon to the value passed in.</div>
</section>
</li>
<li>
<section class="detail" id="getSemiJoinDistinctRowCount(org.apache.calcite.rel.core.Join,org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rex.RexNode)">
<h3>getSemiJoinDistinctRowCount</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">getSemiJoinDistinctRowCount</span><wbr><span class="parameters">(<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;semiJoinRel,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate)</span></div>
<div class="block">Computes the number of distinct rows for a set of keys returned from a
semi-join.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>semiJoinRel</code> - RelNode representing the semi-join</dd>
<dd><code>mq</code> - metadata query</dd>
<dd><code>groupKey</code> - keys that the distinct row count will be computed for</dd>
<dd><code>predicate</code> - join predicate</dd>
<dt>Returns:</dt>
<dd>number of distinct rows</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getJoinDistinctRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.core.JoinRelType,org.apache.calcite.util.ImmutableBitSet,org.apache.calcite.rex.RexNode,boolean)">
<h3>getJoinDistinctRowCount</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">getJoinDistinctRowCount</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;joinRel,
<a href="../core/JoinRelType.html" title="enum in org.apache.calcite.rel.core">JoinRelType</a>&nbsp;joinType,
<a href="../../util/ImmutableBitSet.html" title="class in org.apache.calcite.util">ImmutableBitSet</a>&nbsp;groupKey,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;predicate,
boolean&nbsp;useMaxNdv)</span></div>
<div class="block">Computes the number of distinct rows for a set of keys returned from a
join. Also known as NDV (number of distinct values).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>joinRel</code> - RelNode representing the join</dd>
<dd><code>joinType</code> - type of join</dd>
<dd><code>groupKey</code> - keys that the distinct row count will be computed for</dd>
<dd><code>predicate</code> - join predicate</dd>
<dd><code>useMaxNdv</code> - If true use formula <code>max(left NDV, right NDV)</code>,
otherwise use <code>left NDV * right NDV</code>.</dd>
<dt>Returns:</dt>
<dd>number of distinct rows</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getUnionAllRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Union)">
<h3>getUnionAllRowCount</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getUnionAllRowCount</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Union.html" title="class in org.apache.calcite.rel.core">Union</a>&nbsp;rel)</span></div>
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Union.html" title="class in org.apache.calcite.rel.core"><code>Union</code></a>
(before duplicates are eliminated).</div>
</section>
</li>
<li>
<section class="detail" id="getMinusRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Minus)">
<h3>getMinusRowCount</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getMinusRowCount</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Minus.html" title="class in org.apache.calcite.rel.core">Minus</a>&nbsp;minus)</span></div>
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Minus.html" title="class in org.apache.calcite.rel.core"><code>Minus</code></a>.</div>
</section>
</li>
<li>
<section class="detail" id="getJoinRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.core.Join,org.apache.calcite.rex.RexNode)">
<h3>getJoinRowCount</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">getJoinRowCount</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../core/Join.html" title="class in org.apache.calcite.rel.core">Join</a>&nbsp;join,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition)</span></div>
<div class="block">Returns an estimate of the number of rows returned by a <a href="../core/Join.html" title="class in org.apache.calcite.rel.core"><code>Join</code></a>.</div>
</section>
</li>
<li>
<section class="detail" id="estimateFilteredRows(org.apache.calcite.rel.RelNode,org.apache.calcite.rex.RexProgram,org.apache.calcite.rel.metadata.RelMetadataQuery)">
<h3>estimateFilteredRows</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">estimateFilteredRows</span><wbr><span class="parameters">(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;child,
<a href="../../rex/RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq)</span></div>
</section>
</li>
<li>
<section class="detail" id="estimateFilteredRows(org.apache.calcite.rel.RelNode,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.metadata.RelMetadataQuery)">
<h3>estimateFilteredRows</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">estimateFilteredRows</span><wbr><span class="parameters">(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;child,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq)</span></div>
</section>
</li>
<li>
<section class="detail" id="linear(int,int,int,double,double)">
<h3>linear</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">linear</span><wbr><span class="parameters">(int&nbsp;x,
int&nbsp;minX,
int&nbsp;maxX,
double&nbsp;minY,
double&nbsp;maxY)</span></div>
<div class="block">Returns a point on a line.
<p>The result is always a value between <code>minY</code> and <code>maxY</code>,
even if <code>x</code> is not between <code>minX</code> and <code>maxX</code>.
<p>Examples:<ul>
<li><code>linear(0, 0, 10, 100, 200</code>} returns 100 because 0 is minX
<li><code>linear(5, 0, 10, 100, 200</code>} returns 150 because 5 is
mid-way between minX and maxX
<li><code>linear(5, 0, 10, 100, 200</code>} returns 160
<li><code>linear(10, 0, 10, 100, 200</code>} returns 200 because 10 is maxX
<li><code>linear(-2, 0, 10, 100, 200</code>} returns 100 because -2 is
less than minX and is therefore treated as minX
<li><code>linear(12, 0, 10, 100, 200</code>} returns 100 because 12 is
greater than maxX and is therefore treated as maxX
</ul></div>
</section>
</li>
<li>
<section class="detail" id="checkInputForCollationAndLimit(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelCollation,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)">
<h3>checkInputForCollationAndLimit</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">checkInputForCollationAndLimit</span><wbr><span class="parameters">(<a href="RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;input,
<a href="../RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&nbsp;collation,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;offset,
@Nullable <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;fetch)</span></div>
<div class="block">Returns whether a relational expression is already sorted and has fewer
rows than the sum of offset and limit.
<p>If this is the case, it is safe to push down a
<a href="../core/Sort.html" title="class in org.apache.calcite.rel.core"><code>Sort</code></a> with limit and optional offset.</div>
</section>
</li>
<li>
<section class="detail" id="validatePercentage(java.lang.Double)">
<h3>validatePercentage</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">validatePercentage</span><wbr><span class="parameters">(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;result)</span></div>
<div class="block">Validates whether a value represents a percentage number
(that is, a value in the interval [0.0, 1.0]) and returns the value.
<p>Returns null if and only if <code>result</code> is null.
<p>Throws if <code>result</code> is not null, not in range 0 to 1,
and assertions are enabled.</div>
</section>
</li>
<li>
<section class="detail" id="validateResult(java.lang.Double)">
<h3>validateResult</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a></span>&nbsp;<span class="element-name">validateResult</span><wbr><span class="parameters">(@PolyNull <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&nbsp;result)</span></div>
<div class="block">Validates the <code>result</code> is valid.
<p>Never let the result go below 1, as it will result in incorrect
calculations if the row-count is used as the denominator in a
division expression. Also, cap the value at the max double value
to avoid calculations using infinity.
<p>Returns null if and only if <code>result</code> is null.
<p>Throws if <code>result</code> is not null, is negative,
and assertions are enabled.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the corrected value from the <code>result</code></dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/AssertionError.html" title="class or interface in java.lang" class="external-link">AssertionError</a></code> - if the <code>result</code> is negative</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clearCache(org.apache.calcite.rel.RelNode)">
<h3>clearCache</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">clearCache</span><wbr><span class="parameters">(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;rel)</span></div>
<div class="block">Removes cached metadata values for specified RelNode.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rel</code> - RelNode whose cached metadata should be removed</dd>
<dt>Returns:</dt>
<dd>true if cache for the provided RelNode was not empty</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &copy; 2012-2023 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>