You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2015/07/28 06:16:38 UTC

svn commit: r1692986 - in /phoenix: phoenix-docs/src/docsrc/help/phoenix.csv site/publish/language/functions.html

Author: jamestaylor
Date: Tue Jul 28 04:16:37 2015
New Revision: 1692986

URL: http://svn.apache.org/r1692986
Log:
Add documentation for new ARRAY built-in functions (Dumindu Buddhika)

Modified:
    phoenix/phoenix-docs/src/docsrc/help/phoenix.csv
    phoenix/site/publish/language/functions.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=1692986&r1=1692985&r2=1692986&view=diff
==============================================================================
--- phoenix/phoenix-docs/src/docsrc/help/phoenix.csv (original)
+++ phoenix/phoenix-docs/src/docsrc/help/phoenix.csv Tue Jul 28 04:16:37 2015
@@ -1483,6 +1483,44 @@ ARRAY_APPEND(my_array_col, my_element_co
 ARRAY_APPEND(ARRAY[1,2,3], 4) evaluates to ARRAY[1,2,3,4]
 "
 
+"Functions (Array)","ARRAY_PREPEND","
+ARRAY_PREPEND(elementTerm, arrayTerm)
+","
+Appends the given element to the beginning of the array.
+","
+ARRAY_PREPEND(my_element_col, my_array_col)
+ARRAY_PREPEND(0, ARRAY[1,2,3]) evaluates to ARRAY[0,1,2,3]
+"
+
+"Functions (Array)","ARRAY_CAT","
+ARRAY_CAT(arrayTerm, arrayTerm)
+","
+Concatenates the input arrays and returns the result.
+","
+ARRAY_CAT(my_array_col1, my_array_col2)
+ARRAY_CAT(ARRAY[1,2], ARRAY[3,4]) evaluates to ARRAY[1,2,3,4]
+"
+
+"Functions (Array)","ARRAY_FILL","
+ARRAY_FILL(arrayTerm, lengthNumeric)
+","
+Returns an array initialized with supplied value and length.
+","
+ARRAY_FILL(my_element_col, my_length_col)
+ARRAY_FILL(1, 3) evaluates to ARRAY[1,1,1]
+"
+
+"Functions (Array)","ARRAY_TO_STRING","
+ARRAY_TO_STRING(arrayTerm, delimiterString [, nullString])
+","
+Concatenates array elements using supplied delimiter and optional null string and returns the resulting string. If the nullString parameter is omitted or NULL, any null elements in the array are simply skipped and not represented in the output string.
+","
+ARRAY_TO_STRING(my_array_col, my_delimiter_col, my_null_string_col)
+ARRAY_TO_STRING(ARRAY['a','b','c'], ',') evaluates to 'a,b,c'
+ARRAY_TO_STRING(ARRAY['a','b',null,'c'], ',') evaluates to 'a,b,c'
+ARRAY_TO_STRING(ARRAY['a','b',null,'c'], ',', 'NULL') evaluates to 'a,b,NULL,c'
+"
+
 "Functions (Array)","ANY","
 ANY( arrayTerm )
 ","

Modified: phoenix/site/publish/language/functions.html
URL: http://svn.apache.org/viewvc/phoenix/site/publish/language/functions.html?rev=1692986&r1=1692985&r2=1692986&view=diff
==============================================================================
--- phoenix/site/publish/language/functions.html (original)
+++ phoenix/site/publish/language/functions.html Tue Jul 28 04:16:37 2015
@@ -398,6 +398,14 @@ syntax-end -->
 
     <a href="#array_append" >ARRAY_APPEND</a><br />
 
+    <a href="#array_prepend" >ARRAY_PREPEND</a><br />
+
+    <a href="#array_cat" >ARRAY_CAT</a><br />
+
+    <a href="#array_fill" >ARRAY_FILL</a><br />
+
+    <a href="#array_to_string" >ARRAY_TO_STRING</a><br />
+
     <a href="#any" >ANY</a><br />
 
     <a href="#all" >ALL</a><br />
@@ -411,13 +419,21 @@ syntax-end -->
                 <a href="#array_elem" >ARRAY_ELEM</a><br />
             
                 <a href="#array_length" >ARRAY_LENGTH</a><br />
-                    </td><td class="index">
             
                 <a href="#array_append" >ARRAY_APPEND</a><br />
+                    </td><td class="index">
             
-                <a href="#any" >ANY</a><br />
+                <a href="#array_prepend" >ARRAY_PREPEND</a><br />
+            
+                <a href="#array_cat" >ARRAY_CAT</a><br />
+            
+                <a href="#array_fill" >ARRAY_FILL</a><br />
                     </td><td class="index">
             
+                <a href="#array_to_string" >ARRAY_TO_STRING</a><br />
+            
+                <a href="#any" >ANY</a><br />
+            
                 <a href="#all" >ALL</a><br />
                     </td>
     </tr>
@@ -798,6 +814,78 @@ syntax-end -->
 <p>Example:</p>
 <p class="notranslate">ARRAY_APPEND(my_array_col, my_element_col)<br />ARRAY_APPEND(ARRAY[1,2,3], 4) evaluates to ARRAY[1,2,3,4]</p>
 
+<h3 id="array_prepend" class="notranslate">ARRAY_PREPEND</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+ARRAY_PREPEND(<a href="index.html#term">elementTerm</a>, <a href="index.html#term">arrayTerm</a>)
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ARRAY_PREPEND ( <a href="index.html#term">elementTerm</a> , <a href="index.html#term">arrayTerm</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+ARRAY_PREPEND(<a href="index.html#term">elementTerm</a>, <a href="index.html#term">arrayTerm</a>)
+</pre>
+syntax-end -->
+<p>Appends the given element to the beginning of the array.</p>
+<p>Example:</p>
+<p class="notranslate">ARRAY_PREPEND(my_element_col, my_array_col)<br />ARRAY_PREPEND(0, ARRAY[1,2,3]) evaluates to ARRAY[0,1,2,3]</p>
+
+<h3 id="array_cat" class="notranslate">ARRAY_CAT</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+ARRAY_CAT(<a href="index.html#term">arrayTerm</a>, <a href="index.html#term">arrayTerm</a>)
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ARRAY_CAT ( <a href="index.html#term">arrayTerm</a> , <a href="index.html#term">arrayTerm</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+ARRAY_CAT(<a href="index.html#term">arrayTerm</a>, <a href="index.html#term">arrayTerm</a>)
+</pre>
+syntax-end -->
+<p>Concatenates the input arrays and returns the result.</p>
+<p>Example:</p>
+<p class="notranslate">ARRAY_CAT(my_array_col1, my_array_col2)<br />ARRAY_CAT(ARRAY[1,2], ARRAY[3,4]) evaluates to ARRAY[1,2,3,4]</p>
+
+<h3 id="array_fill" class="notranslate">ARRAY_FILL</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+ARRAY_FILL(<a href="index.html#term">arrayTerm</a>, <a href="index.html#numeric">lengthNumeric</a>)
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ARRAY_FILL ( <a href="index.html#term">arrayTerm</a> , <a href="index.html#numeric">lengthNumeric</a> )</code></td></tr></table>
+</div>
+<!-- railroad-end -->
+<!-- syntax-start
+<pre>
+ARRAY_FILL(<a href="index.html#term">arrayTerm</a>, <a href="index.html#numeric">lengthNumeric</a>)
+</pre>
+syntax-end -->
+<p>Returns an array initialized with supplied value and length.</p>
+<p>Example:</p>
+<p class="notranslate">ARRAY_FILL(my_element_col, my_length_col)<br />ARRAY_FILL(1, 3) evaluates to ARRAY[1,1,1]</p>
+
+<h3 id="array_to_string" class="notranslate">ARRAY_TO_STRING</h3>
+<!-- railroad-start -->
+<pre name="bnf" style="display: none">
+ARRAY_TO_STRING(<a href="index.html#term">arrayTerm</a>, <a href="index.html#string">delimiterString</a> [, <a href="index.html#string">nullString</a>])
+</pre>
+<div name="railroad">
+<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ARRAY_TO_STRING ( <a href="index.html#term">arrayTerm</a> , <a href="index.html#string">delimiterString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</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">nullString</a></code></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>
+ARRAY_TO_STRING(<a href="index.html#term">arrayTerm</a>, <a href="index.html#string">delimiterString</a> [, <a href="index.html#string">nullString</a>])
+</pre>
+syntax-end -->
+<p>Concatenates array elements using supplied delimiter and optional null string and returns the resulting string. If the nullString parameter is omitted or <code>NULL</code>, any null elements in the array are simply skipped and not represented in the output string.</p>
+<p>Example:</p>
+<p class="notranslate">ARRAY_TO_STRING(my_array_col, my_delimiter_col, my_null_string_col)<br />ARRAY_TO_STRING(ARRAY[&#39;a&#39;,&#39;b&#39;,&#39;c&#39;], &#39;,&#39;) evaluates to &#39;a,b,c&#39;<br />ARRAY_TO_STRING(ARRAY[&#39;a&#39;,&#39;b&#39;,null,&#39;c&#39;], &#39;,&#39;) evaluates to &#39;a,b,c&#39;<br />ARRAY_TO_STRING(ARRAY[&#39;a&#39;,&#39;b&#39;,null,&#39;c&#39;], &#39;,&#39;, &#39;NULL&#39;) evaluates to &#39;a,b,NULL,c&#39;</p>
+
 <h3 id="any" class="notranslate">ANY</h3>
 <!-- railroad-start -->
 <pre name="bnf" style="display: none">