You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/09/17 17:53:46 UTC
[impala] 02/04: IMPALA-8945: [DOCS] Fixed an incorrect example of
DISTINT FROM and its equivalent
This is an automated email from the ASF dual-hosted git repository.
tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit e38d57fe5d0266d0423a04b7f0b7350a3fd300f2
Author: Alex Rodoni <ar...@cloudera.com>
AuthorDate: Mon Sep 16 13:30:24 2019 -0700
IMPALA-8945: [DOCS] Fixed an incorrect example of DISTINT FROM and its equivalent
Change-Id: I9bee4c0935ee21d70a0964507c477a2fccb1c7cc
Reviewed-on: http://gerrit.cloudera.org:8080/14239
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
---
docs/topics/impala_operators.xml | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/docs/topics/impala_operators.xml b/docs/topics/impala_operators.xml
index 731022f..0666457 100644
--- a/docs/topics/impala_operators.xml
+++ b/docs/topics/impala_operators.xml
@@ -1045,19 +1045,20 @@ SELECT COUNT(DISTINCT(visitor_id)) FROM web_traffic WHERE month IN ('January','J
<conbody>
- <p>
- <indexterm audience="hidden">IS DISTINCT FROM operator</indexterm>
-
- <indexterm audience="hidden">IS NOT DISTINCT FROM operator</indexterm>
- The <codeph>IS DISTINCT FROM</codeph> operator, and its converse the <codeph>IS NOT DISTINCT FROM</codeph> operator, test whether or
- not values are identical. <codeph>IS NOT DISTINCT FROM</codeph> is similar to the <codeph>=</codeph> operator, and <codeph>IS
- DISTINCT FROM</codeph> is similar to the <codeph>!=</codeph> operator, except that <codeph>NULL</codeph> values are treated as
- identical. Therefore, <codeph>IS NOT DISTINCT FROM</codeph> returns <codeph>true</codeph> rather than <codeph>NULL</codeph>, and
- <codeph>IS DISTINCT FROM</codeph> returns <codeph>false</codeph> rather than <codeph>NULL</codeph>, when comparing two
- <codeph>NULL</codeph> values. If one of the values being compared is <codeph>NULL</codeph> and the other is not, <codeph>IS DISTINCT
- FROM</codeph> returns <codeph>true</codeph> and <codeph>IS NOT DISTINCT FROM</codeph> returns <codeph>false</codeph>, again instead
- of returning <codeph>NULL</codeph> in both cases.
- </p>
+ <p> The <codeph>IS DISTINCT FROM</codeph> operator, and its converse the
+ <codeph>IS NOT DISTINCT FROM</codeph> operator, test whether or not
+ values are identical. <codeph>IS NOT DISTINCT FROM</codeph> is similar
+ to the <codeph>=</codeph> operator, and <codeph>IS DISTINCT
+ FROM</codeph> is similar to the <codeph>!=</codeph> operator, except
+ that <codeph>NULL</codeph> values are treated as identical. Therefore,
+ <codeph>IS NOT DISTINCT FROM</codeph> returns <codeph>true</codeph>
+ rather than <codeph>NULL</codeph>, and <codeph>IS DISTINCT FROM</codeph>
+ returns <codeph>false</codeph> rather than <codeph>NULL</codeph>, when
+ comparing two <codeph>NULL</codeph> values. If one of the values being
+ compared is <codeph>NULL</codeph> and the other is not, <codeph>IS
+ DISTINCT FROM</codeph> returns <codeph>true</codeph> and <codeph>IS
+ NOT DISTINCT FROM</codeph> returns <codeph>false</codeph>, again
+ instead of returning <codeph>NULL</codeph> in both cases. </p>
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
@@ -1083,12 +1084,11 @@ SELECT COUNT(DISTINCT(visitor_id)) FROM web_traffic WHERE month IN ('January','J
<codeph>=</codeph> or <codeph>!=</codeph> operator.
</p>
- <p>
- The <codeph><=></codeph> operator, used like an equality operator in a join query,
- is more efficient than the equivalent clause: <codeph>A = B OR (A IS NULL AND B IS NULL)</codeph>.
- The <codeph><=></codeph> operator can use a hash join, while the <codeph>OR</codeph> expression
- cannot.
- </p>
+ <p> The <codeph><=></codeph> operator, used like an equality
+ operator in a join query, is more efficient than the equivalent clause:
+ <codeph>IF (A IS NULL OR B IS NULL, A IS NULL AND B IS NULL, A =
+ B)</codeph>. The <codeph><=></codeph> operator can use a hash
+ join, while the <codeph>IF</codeph> expression cannot. </p>
<p conref="../shared/impala_common.xml#common/example_blurb"/>