You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by el...@apache.org on 2016/09/07 19:42:11 UTC
svn commit: r1759677 - in /phoenix: phoenix-docs/src/docsrc/help/phoenix.csv
phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt
site/publish/language/datatypes.html site/publish/language/functions.html
site/publish/language/index.html
Author: elserj
Date: Wed Sep 7 19:42:11 2016
New Revision: 1759677
URL: http://svn.apache.org/viewvc?rev=1759677&view=rev
Log:
PHOENIX-2991 Update function documentation
Modified:
phoenix/phoenix-docs/src/docsrc/help/phoenix.csv
phoenix/phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt
phoenix/site/publish/language/datatypes.html
phoenix/site/publish/language/functions.html
phoenix/site/publish/language/index.html
Modified: phoenix/phoenix-docs/src/docsrc/help/phoenix.csv
URL: http://svn.apache.org/viewvc/phoenix/phoenix-docs/src/docsrc/help/phoenix.csv?rev=1759677&r1=1759676&r2=1759677&view=diff
==============================================================================
--- phoenix/phoenix-docs/src/docsrc/help/phoenix.csv (original)
+++ phoenix/phoenix-docs/src/docsrc/help/phoenix.csv Wed Sep 7 19:42:11 2016
@@ -1817,9 +1817,12 @@ can also be set to a time zone id, which
default of GMT to be overridden with the configured
time zone id. Please see the Data Type reference guide about
how Apache Phoenix presently defines the DATE datatype.
+Additionally, Phoenix supports the ANSI SQL ""date"" literal which acts
+similarly to the single-argument ""TO_DATE"" function.
","
TO_DATE('Sat, 3 Feb 2001 03:05:06 GMT', 'EEE, d MMM yyyy HH:mm:ss z')
TO_DATE('1970-01-01', 'yyyy-MM-dd', 'GMT+1')
+date "1970-01-01 12:30:00"
"
"Functions (Time and Date)","CURRENT_DATE","
@@ -1833,6 +1836,38 @@ about how Apache Phoenix presently defin
CURRENT_DATE()
"
+"Functions (Time and Date)","TO_TIME","
+TO_TIME( string [, formatString [, timeZoneIdString]] )
+","
+Converts the given string into a TIME instance. When a date format is not provided
+it defaults to ""yyyy-MM-dd HH:mm:ss.SSS"" or whatever is defined by the
+configuration property ""phoenix.query.dateFormat"". The configuration setting
+""phoenix.query.dateFormatTimeZone"" can also be set to a time zone id, which will
+cause the default of GMT to be overridden with the configured time zone id.
+Additionally, Phoenix supports the ANSI SQL ""time"" literal which acts similarly to the
+single-argument ""TO_TIME"" function.
+","
+TO_TIME('2005-10-01 14:03:22.559')
+TO_TIME('1970-01-01', 'yyyy-MM-dd', 'GMT+1')
+time '2005-10-01 14:03:22.559'
+"
+
+"Functions (Time and Date)","TO_TIMESTAMP","
+TO_TIMESTAMP( string [, formatString [, timeZoneIdString]] )
+","
+Converts the given string into a TIMESTAMP instance. When a date format is not provided
+it defaults to ""yyyy-MM-dd HH:mm:ss.SSS"" or whatever is defined by the
+configuration property ""phoenix.query.dateFormat"". The configuration setting
+""phoenix.query.dateFormatTimeZone"" can also be set to a time zone id, which will
+cause the default of GMT to be overridden with the configured time zone id.
+Additionally, Phoenix supports the ANSI SQL ""timestamp"" literal which acts similarly to
+the single-argument ""TO_TIMESTAMP"" function.
+","
+TO_TIMESTAMP('2005-10-01 14:03:22.559')
+TO_TIMESTAMP('1970-01-01', 'yyyy-MM-dd', 'GMT+1')
+timestamp '2005-10-01 14:03:22.559'
+"
+
"Functions (Time and Date)","CURRENT_TIME","
CURRENT_TIME()
","
@@ -2011,4 +2046,42 @@ LOG(3, 2)
LOG(2, 3)
LOG(2)
"
+"Functions (General)","GET_BIT","
+GET_BIT( binaryValue, offsetInt )
+","
+Retrieves the bit at the given index in the given binary value.
+","
+GET_BIT(CAST('FFFF' as BINARY), 1)
+"
+"Functions (General)","GET_BYTE","
+GET_BYTE( binaryValue, offsetInt )
+","
+Retrieves the byte at the given index in the given binary value.
+","
+GET_BYTE(CAST('FFFF' as BINARY), 1)
+"
+
+"Functions (General)","OCTET_LENGTH","
+OCTET_LENGTH( binaryValue )
+","
+Returns the number of bytes in a binary value.
+","
+OCTET_LENGTH(NAME)
+"
+
+"Functions (General)","SET_BIT","
+SET_BIT( binaryValue, offsetInt, newValue )
+","
+Replaces the bit at the given index in the binary value with the provided newValue.
+","
+SET_BIT(CAST('FFFF' as BINARY), 1, 61)
+"
+
+"Functions (General)","SET_BYTE","
+SET_BYTE( binaryValue, offsetInt, newValue )
+","
+Replaces the byte at the given index in the binary value with the provided newValue.
+","
+SET_BYTE(CAST('FFFF' as BINARY), 1, 61)
+"
Modified: phoenix/phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt
URL: http://svn.apache.org/viewvc/phoenix/phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt?rev=1759677&r1=1759676&r2=1759677&view=diff
==============================================================================
--- phoenix/phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt (original)
+++ phoenix/phoenix-docs/src/tools/org/h2/build/doc/dictionary.txt Wed Sep 7 19:42:11 2016
@@ -729,4 +729,4 @@ rpc doled paranthesis reaching satisfy c
guideposts collects ilike rhs uniformly ttl reviewer ranking earth
hdfs myjar myincrement defaultvalue defualtvalue mypackage raised logarithm euler cbrt
transitioned overriden removal serially parallelized opposed frequency namely tranactional istransactional
-guidepost compaction determination lookups currently presently
+guidepost compaction determination lookups currently presently whatever similarly
Modified: phoenix/site/publish/language/datatypes.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/language/datatypes.html?rev=1759677&r1=1759676&r2=1759677&view=diff
==============================================================================
--- phoenix/site/publish/language/datatypes.html (original)
+++ phoenix/site/publish/language/datatypes.html Wed Sep 7 19:42:11 2016
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2016-09-01
+ Generated by Apache Maven Doxia at 2016-09-07
Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
Modified: phoenix/site/publish/language/functions.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/language/functions.html?rev=1759677&r1=1759676&r2=1759677&view=diff
==============================================================================
--- phoenix/site/publish/language/functions.html (original)
+++ phoenix/site/publish/language/functions.html Wed Sep 7 19:42:11 2016
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2016-09-01
+ Generated by Apache Maven Doxia at 2016-09-07
Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
@@ -297,7 +297,9 @@ syntax-end -->
<a href="#to_date" >TO_DATE</a><br />
- <a href="#current_date" >CURRENT_DATE</a><br />
+ <a href="#to_time" >TO_TIME</a><br />
+
+ <a href="#to_timestamp" >TO_TIMESTAMP</a><br />
<a href="#current_time" >CURRENT_TIME</a><br />
@@ -329,14 +331,16 @@ syntax-end -->
<a href="#to_date" >TO_DATE</a><br />
- <a href="#current_date" >CURRENT_DATE</a><br />
+ <a href="#to_time" >TO_TIME</a><br />
+
+ <a href="#to_timestamp" >TO_TIMESTAMP</a><br />
<a href="#current_time" >CURRENT_TIME</a><br />
<a href="#convert_tz" >CONVERT_TZ</a><br />
+ </td><td class="index">
<a href="#timezone_offset" >TIMEZONE_OFFSET</a><br />
- </td><td class="index">
<a href="#now" >NOW</a><br />
@@ -345,9 +349,9 @@ syntax-end -->
<a href="#month" >MONTH</a><br />
<a href="#week" >WEEK</a><br />
+ </td><td class="index">
<a href="#dayofmonth" >DAYOFMONTH</a><br />
- </td><td class="index">
<a href="#hour" >HOUR</a><br />
@@ -512,6 +516,16 @@ syntax-end -->
<a href="#decode" >DECODE</a><br />
<a href="#coalesce" >COALESCE</a><br />
+
+ <a href="#get_bit" >GET_BIT</a><br />
+
+ <a href="#get_byte" >GET_BYTE</a><br />
+
+ <a href="#octet_length" >OCTET_LENGTH</a><br />
+
+ <a href="#set_bit" >SET_BIT</a><br />
+
+ <a href="#set_byte" >SET_BYTE</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
@@ -522,7 +536,6 @@ syntax-end -->
<a href="#md5" >MD5</a><br />
<a href="#invert" >INVERT</a><br />
- </td><td class="index">
<a href="#encode" >ENCODE</a><br />
@@ -530,6 +543,17 @@ syntax-end -->
</td><td class="index">
<a href="#coalesce" >COALESCE</a><br />
+
+ <a href="#get_bit" >GET_BIT</a><br />
+
+ <a href="#get_byte" >GET_BYTE</a><br />
+
+ <a href="#octet_length" >OCTET_LENGTH</a><br />
+ </td><td class="index">
+
+ <a href="#set_bit" >SET_BIT</a><br />
+
+ <a href="#set_byte" >SET_BYTE</a><br />
</td>
</tr>
</table>
@@ -1023,6 +1047,96 @@ syntax-end -->
<p>Example:</p>
<p class="notranslate">COALESCE(last_update_date, CURRENT_DATE())</p>
+<h3 id="get_bit" class="notranslate">GET_BIT</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+GET_BIT( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a> )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">GET_BIT ( <a href="index.html#value">binaryValue</a> , <a href="index.html#int">offsetInt</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+GET_BIT( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a> )
+</pre>
+syntax-end -->
+<p>Retrieves the bit at the given index in the given binary value.</p>
+<p>Example:</p>
+<p class="notranslate">GET_BIT(CAST('FFFF' as BINARY), 1)</p>
+
+<h3 id="get_byte" class="notranslate">GET_BYTE</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+GET_BYTE( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a> )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">GET_BYTE ( <a href="index.html#value">binaryValue</a> , <a href="index.html#int">offsetInt</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+GET_BYTE( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a> )
+</pre>
+syntax-end -->
+<p>Retrieves the byte at the given index in the given binary value.</p>
+<p>Example:</p>
+<p class="notranslate">GET_BYTE(CAST('FFFF' as BINARY), 1)</p>
+
+<h3 id="octet_length" class="notranslate">OCTET_LENGTH</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+OCTET_LENGTH( <a href="index.html#value">binaryValue</a> )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">OCTET_LENGTH ( <a href="index.html#value">binaryValue</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+OCTET_LENGTH( <a href="index.html#value">binaryValue</a> )
+</pre>
+syntax-end -->
+<p>Returns the number of bytes in a binary value.</p>
+<p>Example:</p>
+<p class="notranslate">OCTET_LENGTH(NAME)</p>
+
+<h3 id="set_bit" class="notranslate">SET_BIT</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+SET_BIT( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a>, <a href="index.html#value">newValue</a> )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET_BIT ( <a href="index.html#value">binaryValue</a> , <a href="index.html#int">offsetInt</a> , <a href="index.html#value">newValue</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+SET_BIT( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a>, <a href="index.html#value">newValue</a> )
+</pre>
+syntax-end -->
+<p>Replaces the bit at the given index in the binary value with the provided newValue.</p>
+<p>Example:</p>
+<p class="notranslate">SET_BIT(CAST('FFFF' as BINARY), 1, 61)</p>
+
+<h3 id="set_byte" class="notranslate">SET_BYTE</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+SET_BYTE( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a>, <a href="index.html#value">newValue</a> )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET_BYTE ( <a href="index.html#value">binaryValue</a> , <a href="index.html#int">offsetInt</a> , <a href="index.html#value">newValue</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+SET_BYTE( <a href="index.html#value">binaryValue</a>, <a href="index.html#int">offsetInt</a>, <a href="index.html#value">newValue</a> )
+</pre>
+syntax-end -->
+<p>Replaces the byte at the given index in the binary value with the provided newValue.</p>
+<p>Example:</p>
+<p class="notranslate">SET_BYTE(CAST('FFFF' as BINARY), 1, 61)</p>
+
<h3 id="sign" class="notranslate">SIGN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
@@ -1541,27 +1655,45 @@ TO_DATE( <a href="index.html#term">strin
TO_DATE( <a href="index.html#term">stringTerm</a> [, <a href="index.html#string">formatString</a> [, <a href="index.html#string">timeZoneIdString</a>]] )
</pre>
syntax-end -->
-<p>Parses a string and returns a date. Note that the returned date is internally represented as the number of milliseconds since the java epoch. The most important format characters are: y year, M month, d day, H hour, m minute, s second. The default format string is <code>yyyy-MM-dd HH:mm:ss</code>. For details of the format, see <code>java.text.SimpleDateFormat</code>. By default, <code>GMT</code> will be used as the time zone when parsing the date. However, a time zone id can also be supplied. This is a time zone id such as '<code>GMT</code>+1'. If 'local' is provided as the time zone id, the local time zone will be used for parsing. The configuration setting <code>phoenix.query.dateFormatTimeZone</code> can also be set to a time zone id, which will cause the default of <code>GMT</code> to be overridden with the configured time zone id. Please see the Data Type reference guide about how Apache Phoenix presently defines the <code>DATE</code> datatype.</p>
+<p>Parses a string and returns a date. Note that the returned date is internally represented as the number of milliseconds since the java epoch. The most important format characters are: y year, M month, d day, H hour, m minute, s second. The default format string is <code>yyyy-MM-dd HH:mm:ss</code>. For details of the format, see <code>java.text.SimpleDateFormat</code>. By default, <code>GMT</code> will be used as the time zone when parsing the date. However, a time zone id can also be supplied. This is a time zone id such as '<code>GMT</code>+1'. If 'local' is provided as the time zone id, the local time zone will be used for parsing. The configuration setting <code>phoenix.query.dateFormatTimeZone</code> can also be set to a time zone id, which will cause the default of <code>GMT</code> to be overridden with the configured time zone id. Please see the Data Type reference guide about how Apache Phoenix presently defines the <code>DATE</code> datatype. Additionally,
Phoenix supports the <code>ANSI SQL date</code> literal which acts similarly to the single-argument <code>TO_DATE</code> function.</p>
+<p>Example:</p>
+<p class="notranslate">TO_DATE('Sat, 3 Feb 2001 03:05:06 GMT', 'EEE, d MMM yyyy HH:mm:ss z')<br />TO_DATE('1970-01-01', 'yyyy-MM-dd', 'GMT+1')<br />date</p>
+
+<h3 id="to_time" class="notranslate">TO_TIME</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+TO_TIME( <a href="index.html#string">string</a> [, <a href="index.html#string">formatString</a> [, <a href="index.html#string">timeZoneIdString</a>]] )
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TO_TIME ( <a href="index.html#string">string</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"> </td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="index.html#string">formatString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"> </td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="index.html#string">timeZoneIdString</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+TO_TIME( <a href="index.html#string">string</a> [, <a href="index.html#string">formatString</a> [, <a href="index.html#string">timeZoneIdString</a>]] )
+</pre>
+syntax-end -->
+<p>Converts the given string into a <code>TIME</code> instance. When a date format is not provided it defaults to <code>yyyy-MM-dd HH:mm:ss.SSS</code> or whatever is defined by the configuration property <code>phoenix.query.dateFormat</code>. The configuration setting <code>phoenix.query.dateFormatTimeZone</code> can also be set to a time zone id, which will cause the default of <code>GMT</code> to be overridden with the configured time zone id. Additionally, Phoenix supports the <code>ANSI SQL time</code> literal which acts similarly to the single-argument <code>TO_TIME</code> function.</p>
<p>Example:</p>
-<p class="notranslate">TO_DATE('Sat, 3 Feb 2001 03:05:06 GMT', 'EEE, d MMM yyyy HH:mm:ss z')<br />TO_DATE('1970-01-01', 'yyyy-MM-dd', 'GMT+1')</p>
+<p class="notranslate">TO_TIME('2005-10-01 14:03:22.559')<br />TO_TIME('1970-01-01', 'yyyy-MM-dd', 'GMT+1')<br />time '2005-10-01 14:03:22.559'</p>
-<h3 id="current_date" class="notranslate">CURRENT_DATE</h3>
+<h3 id="to_timestamp" class="notranslate">TO_TIMESTAMP</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
-CURRENT_DATE()
+TO_TIMESTAMP( <a href="index.html#string">string</a> [, <a href="index.html#string">formatString</a> [, <a href="index.html#string">timeZoneIdString</a>]] )
</pre>
<div name="railroad">
-<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CURRENT_DATE ( )</code></td></tr></table>
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TO_TIMESTAMP ( <a href="index.html#string">string</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"> </td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="index.html#string">formatString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"> </td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="index.html#string">timeZoneIdString</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
-CURRENT_DATE()
+TO_TIMESTAMP( <a href="index.html#string">string</a> [, <a href="index.html#string">formatString</a> [, <a href="index.html#string">timeZoneIdString</a>]] )
</pre>
syntax-end -->
-<p>Returns the current server-side date, bound at the start of the execution of a query based on the current time on the region server owning the metadata of the table being queried. Please see the Data Type reference guide about how Apache Phoenix presently defines the <code>DATE</code> datatype.</p>
+<p>Converts the given string into a <code>TIMESTAMP</code> instance. When a date format is not provided it defaults to <code>yyyy-MM-dd HH:mm:ss.SSS</code> or whatever is defined by the configuration property <code>phoenix.query.dateFormat</code>. The configuration setting <code>phoenix.query.dateFormatTimeZone</code> can also be set to a time zone id, which will cause the default of <code>GMT</code> to be overridden with the configured time zone id. Additionally, Phoenix supports the <code>ANSI SQL timestamp</code> literal which acts similarly to the single-argument <code>TO_TIMESTAMP</code> function.</p>
<p>Example:</p>
-<p class="notranslate">CURRENT_DATE()</p>
+<p class="notranslate">TO_TIMESTAMP('2005-10-01 14:03:22.559')<br />TO_TIMESTAMP('1970-01-01', 'yyyy-MM-dd', 'GMT+1')<br />timestamp '2005-10-01 14:03:22.559'</p>
<h3 id="current_time" class="notranslate">CURRENT_TIME</h3>
<!-- railroad-start -->
Modified: phoenix/site/publish/language/index.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/language/index.html?rev=1759677&r1=1759676&r2=1759677&view=diff
==============================================================================
--- phoenix/site/publish/language/index.html (original)
+++ phoenix/site/publish/language/index.html Wed Sep 7 19:42:11 2016
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!--
- Generated by Apache Maven Doxia at 2016-09-01
+ Generated by Apache Maven Doxia at 2016-09-07
Rendered using Reflow Maven Skin 1.1.0 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">