blob: fcd4488e2febe7f53f8c13bc137232547037ec1c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="copyright" content="(C) Copyright 2023" />
<meta name="DC.rights.owner" content="(C) Copyright 2023" />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="APPX_COUNT_DISTINCT Query Option (Impala 2.0 or higher only)" />
<meta name="DC.Relation" scheme="URI" content="../topics/impala_query_options.html" />
<meta name="prodname" content="Impala" />
<meta name="prodname" content="Impala" />
<meta name="version" content="Impala 3.4.x" />
<meta name="version" content="Impala 3.4.x" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="appx_count_distinct" />
<link rel="stylesheet" type="text/css" href="../commonltr.css" />
<title>APPX_COUNT_DISTINCT Query Option (Impala 2.0 or higher only)</title>
</head>
<body id="appx_count_distinct">
<h1 class="title topictitle1" id="ariaid-title1">APPX_COUNT_DISTINCT Query Option (<span class="keyword">Impala 2.0</span> or higher only)</h1>
<div class="body conbody">
<p class="p">
When the <code class="ph codeph">APPX_COUNT_DISTINCT</code> query option is set to
<code class="ph codeph">TRUE</code>, Impala implicitly converts <code class="ph codeph">COUNT(DISTINCT)</code>
operations to the <code class="ph codeph">NDV()</code> function calls. The resulting count is
approximate rather than precise. Enable the query option when a tolerable amount of error
is acceptable in order to obtain faster query results than with a <code class="ph codeph">COUNT
(DISTINCT)</code> queries.
</p>
<p class="p">
<strong class="ph b">Type:</strong> Boolean; recognized values are 1 and 0, or <code class="ph codeph">true</code> and
<code class="ph codeph">false</code>; any other value interpreted as <code class="ph codeph">false</code>
</p>
<p class="p">
<strong class="ph b">Default:</strong> <code class="ph codeph">false</code> (shown as 0 in output of <code class="ph codeph">SET</code>
statement)
</p>
<p class="p">
<strong class="ph b">Related information:</strong>
</p>
<p class="p">
<a class="xref" href="impala_count.html#count">COUNT Function</a>,
<a class="xref" href="impala_distinct.html#distinct">DISTINCT Operator</a>, <a class="xref" href="impala_ndv.html#ndv">NDV Function</a>
</p>
</div>
<div class="related-links">
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_query_options.html">Query Options for the SET Statement</a></div>
</div>
</div></body>
</html>