IMPALA-278: Mention DIV arithmetic operator.

Also touch up the signatures of the related quotient() function,
which are looking a bit stale since the very early days.

Change-Id: I85093383ca6f32ba69f46fdf0220a1026e36f37f
Reviewed-on: http://gerrit.cloudera.org:8080/5634
Reviewed-by: Alex Behm <[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/2a314e78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/2a314e78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/2a314e78

Branch: refs/heads/master
Commit: 2a314e780eb22279e6a9bc402744f96f06a5c99c
Parents: eaefbb9
Author: John Russell <[email protected]>
Authored: Fri Jan 6 14:35:34 2017 -0800
Committer: Impala Public Jenkins <[email protected]>
Committed: Wed Jan 25 21:06:23 2017 +0000

----------------------------------------------------------------------
 docs/topics/impala_math_functions.xml | 11 +++++++----
 docs/topics/impala_operators.xml      |  8 ++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/2a314e78/docs/topics/impala_math_functions.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_math_functions.xml 
b/docs/topics/impala_math_functions.xml
index d63b0e7..94753b7 100644
--- a/docs/topics/impala_math_functions.xml
+++ b/docs/topics/impala_math_functions.xml
@@ -1041,16 +1041,19 @@ select pmod(5,-2);
       <dlentry id="quotient">
 
         <dt>
-          <codeph>quotient(int numerator, int denominator)</codeph>
+          <codeph>quotient(bigint numerator, bigint denominator)</codeph>,
+          <codeph>quotient(double numerator, double denominator)</codeph>
         </dt>
 
         <dd>
           <indexterm audience="hidden">quotient() function</indexterm>
           <b>Purpose:</b> Returns the first argument divided by the second 
argument, discarding any fractional
-          part. Avoids promoting arguments to <codeph>DOUBLE</codeph> as 
happens with the <codeph>/</codeph> SQL
-          operator.
+          part. Avoids promoting integer arguments to <codeph>DOUBLE</codeph> 
as happens with the <codeph>/</codeph> SQL
+          operator. <ph rev="IMPALA-278">Also includes an overload that 
accepts <codeph>DOUBLE</codeph> arguments,
+          discards the fractional part of each argument value before dividing, 
and again returns <codeph>BIGINT</codeph>.
+          With integer arguments, this function works the same as the 
<codeph>DIV</codeph> operator.</ph>
           <p>
-            <b>Return type:</b> <codeph>int</codeph>
+            <b>Return type:</b> <codeph>bigint</codeph>
           </p>
         </dd>
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/2a314e78/docs/topics/impala_operators.xml
----------------------------------------------------------------------
diff --git a/docs/topics/impala_operators.xml b/docs/topics/impala_operators.xml
index 2a944ce..75b4461 100644
--- a/docs/topics/impala_operators.xml
+++ b/docs/topics/impala_operators.xml
@@ -108,6 +108,14 @@ under the License.
           </p>
         </li>
 
+        <li id="div" rev="IMPALA-278">
+          <p>
+            <codeph>DIV</codeph>: Integer division. Arguments are not promoted 
to a floating-point type, and any fractional result
+            is discarded. For example, <codeph>13 DIV 7</codeph> returns 1, 
<codeph>14 DIV 7</codeph> returns 2, and
+            <codeph>15 DIV 7</codeph> returns 2. This operator is the same as 
the <codeph>QUOTIENT()</codeph> function.
+          </p>
+        </li>
+
         <li>
           <p>
             <codeph>%</codeph>: Modulo operator. Returns the remainder of the 
left-hand argument divided by the right-hand argument. Both

Reply via email to