IMPALA-3603 [DOCS] Document handling of NaN values Added information in the "DOUBLE Data Type" (impala_double.html) and the "FLOAT Data Type" (impala_float.html) topics about how Impala handles NaN values.
Change-Id: Id9485b6790d58fafdae32332d2634cbe893d7fb0 Reviewed-on: http://gerrit.cloudera.org:8080/7098 Reviewed-by: Michael Brown <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/f1a3d8e1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/f1a3d8e1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/f1a3d8e1 Branch: refs/heads/master Commit: f1a3d8e14dae4948ce77e2f85e036d83f2d8b246 Parents: 09ff2fc Author: Laurel Hale <[email protected]> Authored: Tue Jun 6 16:54:25 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Tue Jul 11 00:26:13 2017 +0000 ---------------------------------------------------------------------- docs/shared/impala_common.xml | 6 ++++++ docs/topics/impala_double.xml | 7 +++++++ docs/topics/impala_float.xml | 9 +++++++++ 3 files changed, 22 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/f1a3d8e1/docs/shared/impala_common.xml ---------------------------------------------------------------------- diff --git a/docs/shared/impala_common.xml b/docs/shared/impala_common.xml index 2ec2537..f33570d 100644 --- a/docs/shared/impala_common.xml +++ b/docs/shared/impala_common.xml @@ -2378,6 +2378,12 @@ flight_num: INT32 SNAPPY DO:83456393 FPO:83488603 SZ:10216514/11474301 <b>Usage notes:</b> </p> + <p id="how_impala_handles_nan_values"> + Impala does not evaluate NaN (not a number) as equal to any other numeric values, + including other NaN values. For example, the following statement, which evaluates equality + between two NaN values, returns <codeph>false</codeph>: + </p> + <p id="example_blurb"> <b>Examples:</b> </p> http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/f1a3d8e1/docs/topics/impala_double.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_double.xml b/docs/topics/impala_double.xml index 0dfa137..3f6e5b8 100644 --- a/docs/topics/impala_double.xml +++ b/docs/topics/impala_double.xml @@ -78,6 +78,13 @@ under the License. The data type <codeph>REAL</codeph> is an alias for <codeph>DOUBLE</codeph>. </p> + <!--Below conref'd content fixes IMPALA-3603--> + <p conref="../shared/impala_common.xml#common/how_impala_handles_nan_values"/> + +<codeblock> +SELECT CAST('nan' AS DOUBLE)=CAST('nan' AS DOUBLE); +</codeblock> + <p conref="../shared/impala_common.xml#common/example_blurb"/> <codeblock>CREATE TABLE t1 (x DOUBLE); http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/f1a3d8e1/docs/topics/impala_float.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_float.xml b/docs/topics/impala_float.xml index 12f87b0..1443689 100644 --- a/docs/topics/impala_float.xml +++ b/docs/topics/impala_float.xml @@ -72,6 +72,15 @@ under the License. <ph conref="../shared/impala_common.xml#common/cast_int_to_timestamp"/> </p> + <p conref="../shared/impala_common.xml#common/usage_notes_blurb"/> + + <!--Below conref'd content fixes IMPALA-3603--> + <p conref="../shared/impala_common.xml#common/how_impala_handles_nan_values"/> + +<codeblock> +SELECT CAST('nan' AS FLOAT)=CAST('nan' AS FLOAT); +</codeblock> + <p conref="../shared/impala_common.xml#common/example_blurb"/> <codeblock>CREATE TABLE t1 (x FLOAT);
