You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by br...@apache.org on 2015/04/07 00:50:23 UTC

svn commit: r1671710 [2/2] - in /drill/site/trunk/content/drill: ./ docs/ docs/aggregate-and-aggregate-statistical/ docs/apache-drill-contribution-guidelines/ docs/apache-drill-contribution-ideas/ docs/compiling-drill-from-source/ docs/data-type-conver...

Added: drill/site/trunk/content/drill/docs/overview/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/overview/index.html?rev=1671710&view=auto
==============================================================================
--- drill/site/trunk/content/drill/docs/overview/index.html (added)
+++ drill/site/trunk/content/drill/docs/overview/index.html Mon Apr  6 22:50:22 2015
@@ -0,0 +1,530 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+
+<meta charset="UTF-8">
+
+
+<title>Overview - Apache Drill</title>
+
+<link href="/css/syntax.css" rel="stylesheet" type="text/css">
+<link href="/css/style.css" rel="stylesheet" type="text/css">
+<link href="/css/arrows.css" rel="stylesheet" type="text/css">
+<link href="/css/button.css" rel="stylesheet" type="text/css">
+
+<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+<link rel="icon" href="/favicon.ico" type="image/x-icon">
+
+<script language="javascript" type="text/javascript" src="/js/lib/jquery-1.11.1.min.js"></script>
+<script language="javascript" type="text/javascript" src="/js/lib/jquery.easing.1.3.js"></script>
+<script language="javascript" type="text/javascript" src="/js/modernizr.custom.js"></script>
+<script language="javascript" type="text/javascript" src="/js/script.js"></script>
+
+</head>
+
+<body onResize="resized();">
+
+<div class="bui"></div>
+
+<div id="search">
+<input type="text" placeholder="Enter search term here">
+</div>
+
+<div id="menu" class="mw">
+<ul>
+  <li class="logo"><a href="/"></a></li>
+  <li>
+    <a href="/overview/">Documentation</a>
+    <ul>
+      <li><a href="/overview/">Overview&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
+      <li><a href="http://drill.apache.org/docs/apache-drill-in-10-minutes/" target="_blank">Drill in 10 Minutes</a></li>
+      <li><a href="/why/">Why Drill? &nbsp;&nbsp;&nbsp;&nbsp;</a></li>
+      <li><a href="/architecture/">Architecture</a></li>
+    </ul>
+  </li>
+  <li>
+    <a href="/community/">Community</a>
+    <ul>
+      <li><a href="/team/">Team</a></li>
+      <li><a href="/community/#events">Events and Meetups</a></li>
+      <li><a href="/community/#mailinglists">Mailing Lists</a></li>
+      <li><a href="/community/#getinvolved">Get Involved</a></li>
+      <li><a href="https://issues.apache.org/jira/browse/DRILL/" target="_blank">Issue Tracker</a></li>
+      <li><a href="https://github.com/apache/drill" target="_blank">GitHub</a></li>
+    </ul>
+  </li>
+  <li><a href="/faq/">FAQ</a></li>
+  <li><a href="/blog/">Blog</a></li>
+  <li style="width:30px; padding-left: 2px; padding-right:10px"><a href="https://twitter.com/apachedrill" target="_blank"><img src="/images/twitterbw.png" alt="" align="center" width="22" style="padding: 0px 10px 1px 0px;"></a> </li>
+  <li class="l"><span>&nbsp;</span></li>
+  <li class="d"><a href="/download/">Download</a></li>
+</ul>
+</div>
+
+<div class="int_title">
+<h1>Overview</h1>
+
+</div>
+
+<div class="int_text" align="left"><p>The sys.options table in Drill contains information about boot and system options described in the following tables. You configure some of the options to tune performance. You can configure the options using the ALTER SESSION or ALTER SYSTEM command.</p>
+
+<h2 id="boot-options">Boot Options</h2>
+
+<table>
+  <tr>
+    <th>Name</th>
+    <th>Default</th>
+    <th>Description</th>
+  </tr>
+  <tr>
+    <td>drill.exec.buffer.impl</td>
+    <td>"org.apache.drill.exec.work.batch.UnlimitedRawBatchBuffer"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.buffer.size</td>
+    <td>6</td>
+    <td>Available memory in terms of record batches to hold data downstream of an operation.Increase this value to increase query speed.</td>
+  </tr>
+  <tr>
+    <td>drill.exec.compile.debug</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.http.enabled</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.operator.packages</td>
+    <td>"org.apache.drill.exec.physical.config"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.sort.external.batch.size</td>
+    <td>4000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.sort.external.spill.directories</td>
+    <td>"/tmp/drill/spill"</td>
+    <td>Determines which directory to use for spooling</td>
+  </tr>
+  <tr>
+    <td>drill.exec.sort.external.spill.group.size</td>
+    <td>100</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.storage.file.text.batch.size</td>
+    <td>4000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.storage.packages</td>
+    <td>"org.apache.drill.exec.store" "org.apache.drill.exec.store.mock"</td>
+    <td>#   This file tells Drill to consider this module when class path scanning.     #   This file can also include any supplementary configuration information.  #   This file is in HOCON format see https://github.com/typesafehub/config/blob/master/HOCON.md for more information.</td>
+  </tr>
+  <tr>
+    <td>drill.exec.sys.store.provider.class</td>
+    <td>"org.apache.drill.exec.store.sys.zk.ZkPStoreProvider"</td>
+    <td>The Pstore (Persistent Configuration Storage) provider to use. The Pstore holds configuration and profile data.</td>
+  </tr>
+  <tr>
+    <td>drill.exec.zk.connect</td>
+    <td>"localhost:2181"</td>
+    <td>The ZooKeeper quorum that Drill uses to connect to data sources. Configure on each Drillbit node.</td>
+  </tr>
+  <tr>
+    <td>drill.exec.zk.refresh</td>
+    <td>500</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>file.separator</td>
+    <td>"/"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>java.specification.version</td>
+    <td>1.7</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>java.vm.name</td>
+    <td>"Java HotSpot(TM) 64-Bit Server VM"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>java.vm.specification.version</td>
+    <td>1.7</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>log.path</td>
+    <td>"/log/sqlline.log"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>sun.boot.library.path</td>
+    <td>/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>sun.java.command</td>
+    <td>"sqlline.SqlLine -d org.apache.drill.jdbc.Driver --maxWidth=10000 -u jdbc:drill:zk=local"</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>sun.os.patch.level</td>
+    <td>unknown</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>user</td>
+    <td>""</td>
+    <td></td>
+  </tr>
+</table>
+
+<h2 id="system-options">System Options</h2>
+
+<table>
+  <tr>
+    <th>name</th>
+    <th>Default</th>
+    <th>Description</th>
+  </tr>
+  <tr>
+    <td>drill.exec.functions.cast_empty_string_to_null</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.storage.file.partition.column.label</td>
+    <td>dir</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>drill.exec.testing.exception-injections</td>
+    <td></td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.errors.verbose</td>
+    <td>FALSE</td>
+    <td>Toggles verbose output of executable error messages</td>
+  </tr>
+  <tr>
+    <td>exec.java_compiler</td>
+    <td>DEFAULT</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.java_compiler_debug</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.java_compiler_janino_maxsize</td>
+    <td>262144</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.max_hash_table_size</td>
+    <td>1073741824</td>
+    <td>Starting size for hash tables. Increase according to available memory to improve performance.</td>
+  </tr>
+  <tr>
+    <td>exec.min_hash_table_size</td>
+    <td>65536</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.queue.enable</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.queue.large</td>
+    <td>10</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.queue.small</td>
+    <td>100</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.queue.threshold</td>
+    <td>30000000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>exec.queue.timeout_millis</td>
+    <td>300000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>org.apache.drill.exec.compile.ClassTransformer.scalar_replacement</td>
+    <td>try</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.add_producer_consumer</td>
+    <td>FALSE</td>
+    <td>Increase prefetching of data from disk. Disable for in-memory reads.</td>
+  </tr>
+  <tr>
+    <td>planner.affinity_factor</td>
+    <td>1.2</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.broadcast_factor</td>
+    <td>1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.broadcast_threshold</td>
+    <td>10000000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.disable_exchanges</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_broadcast_join</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_demux_exchange</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_hash_single_key</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_hashagg</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_hashjoin</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_hashjoin_swap</td>
+    <td></td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_mergejoin</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_multiphase_agg</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_mux_exchange</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.enable_streamagg</td>
+    <td>TRUE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.identifier_max_length</td>
+    <td>1024</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.join.hash_join_swap_margin_factor</td>
+    <td>10</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.join.row_count_estimate_factor</td>
+    <td>1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.average_field_width</td>
+    <td>8</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.enable_memory_estimation</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.hash_agg_table_factor</td>
+    <td>1.1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.hash_join_table_factor</td>
+    <td>1.1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.max_query_memory_per_node</td>
+    <td>2147483648</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.memory.non_blocking_operators_memory</td>
+    <td>64</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.partitioner_sender_max_threads</td>
+    <td>8</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.partitioner_sender_set_threads</td>
+    <td>-1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.partitioner_sender_threads_factor</td>
+    <td>1</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.producer_consumer_queue_size</td>
+    <td>10</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.slice_target</td>
+    <td>100000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.width.max_per_node</td>
+    <td>3</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>planner.width.max_per_query</td>
+    <td>1000</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.format</td>
+    <td>parquet</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.json.all_text_mode</td>
+    <td>FALSE</td>
+    <td>Drill reads all data from the JSON files as VARCHAR. Prevents schema change errors.</td>
+  </tr>
+  <tr>
+    <td>store.mongo.all_text_mode</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.block-size</td>
+    <td>536870912</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.compression</td>
+    <td>snappy</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.enable_dictionary_encoding</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.use_new_reader</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.vector_fill_check_threshold</td>
+    <td>10</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>store.parquet.vector_fill_threshold</td>
+    <td>85</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>window.enable</td>
+    <td>FALSE</td>
+    <td></td>
+  </tr>
+</table>
+
+<p>You can configure the amount of direct memory allocated to a Drillbit for
+query processing. The default limit is 8G, but Drill prefers 16G or more
+depending on the workload. The total amount of direct memory that a Drillbit
+allocates to query operations cannot exceed the limit set.</p>
+
+<p>Drill mainly uses Java direct memory and performs well when executing
+operations in memory instead of storing the operations on disk. Drill does not
+write to disk unless absolutely necessary, unlike MapReduce where everything
+is written to disk during each phase of a job.</p>
+
+<p>The JVM’s heap memory does not limit the amount of direct memory available in
+a Drillbit. The on-heap memory for Drill is only about 4-8G, which should
+suffice because Drill avoids having data sit in heap memory.</p>
+
+<h2 id="modifying-drillbit-memory">Modifying Drillbit Memory</h2>
+
+<p>You can modify memory for each Drillbit node in your cluster. To modify the
+memory for a Drillbit, edit the <code>XX:MaxDirectMemorySize</code> parameter in the
+Drillbit startup script located in <code>&lt;drill_installation_directory&gt;/conf/drill-
+env.sh</code>.</p>
+
+<p><strong>Note:</strong> If this parameter is not set, the limit depends on the amount of available system memory.</p>
+
+<p>After you edit <code>&lt;drill_installation_directory&gt;/conf/drill-env.sh</code>, <a href="/docs/starting-stopping-drill#starting-a-drillbit">restart
+the Drillbit
+</a>on
+the node.</p>
+</div>
+
+
+<div id="footer" class="mw">
+<div class="wrapper">
+Copyright © 2012-2014 The Apache Software Foundation, licensed under the Apache License, Version 2.0.<br>
+Apache and the Apache feather logo are trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.<br/><br/>
+</div>
+</div>
+
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ga('create', 'UA-53379651-1', 'auto');
+ga('send', 'pageview');
+</script>
+
+</body>
+</html>

Modified: drill/site/trunk/content/drill/docs/querying-hbase/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/querying-hbase/index.html?rev=1671710&r1=1671709&r2=1671710&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/querying-hbase/index.html (original)
+++ drill/site/trunk/content/drill/docs/querying-hbase/index.html Mon Apr  6 22:50:22 2015
@@ -67,25 +67,29 @@
 
 </div>
 
-<div class="int_text" align="left"><p>This is a simple exercise that provides steps for creating a “students” table
-and a “clicks” table in HBase that you can query with Drill.</p>
+<div class="int_text" align="left"><p>This exercise creates two tables in HBase, students and clicks, that you can query with Drill. You can use the Drill Sandbox to step through the exercise.</p>
 
-<p>To create the HBase tables and query them with Drill, complete the following
+<h2 id="create-the-hbase-tables">Create the HBase tables</h2>
+
+<p>To create the HBase tables and start Drill, complete the following
 steps:</p>
 
 <ol>
-<li><p>Issue the following command to start the HBase shell:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">hbase shell
-</code></pre></div></li>
-<li><p>Issue the following commands to create a ‘students’ table and a ‘clicks’ table with column families in HBase:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">echo &quot;create &#39;students&#39;,&#39;account&#39;,&#39;address&#39;&quot; | hbase shell
+<li><p>Pipe the following commands to the HBase shell to create students and  clicks tables in HBase:</p>
 
-echo &quot;create &#39;clicks&#39;,&#39;clickinfo&#39;,&#39;iteminfo&#39;&quot; | hbase shell
-</code></pre></div></li>
-<li><p>Issue the following command with the provided data to create a <code>testdata.txt</code> file:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">cat &gt; testdata.txt
+<p>echo &quot;create &#39;students&#39;,&#39;account&#39;,&#39;address&#39;&quot; | hbase shell</p>
+
+<p>echo &quot;create &#39;clicks&#39;,&#39;clickinfo&#39;,&#39;iteminfo&#39;&quot; | hbase shell</p></li>
+</ol>
+
+<p>On the Drill Sandbox, HBase tables are located in:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">    /mapr/demo.mapr.com/tables
 </code></pre></div>
-<p><strong>Sample Data</strong></p>
+<ol>
+<li><p>Issue the following command to create a <code>testdata.txt</code> file:</p>
+
+<p>cat &gt; testdata.txt</p></li>
+<li><p>Copy and paste the following <code>put</code> commands on the line below the <strong>cat</strong> command. Press Return, and then CTRL Z to close the file.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">put &#39;students&#39;,&#39;student1&#39;,&#39;account:name&#39;,&#39;Alice&#39;
 put &#39;students&#39;,&#39;student1&#39;,&#39;address:street&#39;,&#39;123 Ballmer Av&#39;
 put &#39;students&#39;,&#39;student1&#39;,&#39;address:zipcode&#39;,&#39;12345&#39;
@@ -148,67 +152,76 @@ put &#39;clicks&#39;,&#39;click9&#39;,&#
 put &#39;clicks&#39;,&#39;click9&#39;,&#39;iteminfo:itemtype&#39;,&#39;image&#39;
 put &#39;clicks&#39;,&#39;click9&#39;,&#39;iteminfo:quantity&#39;,&#39;10&#39;
 </code></pre></div></li>
-<li><p>Issue the following command to verify that the data is in the <code>testdata.txt</code> file:  </p>
-<div class="highlight"><pre><code class="language-text" data-lang="text"> cat testdata.txt | hbase shell
+<li><p>Issue the following command to put the data into hbase:  </p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">cat testdata.txt | hbase shell
+</code></pre></div></li>
+<li><p>Start Drill. Type <code>sqlline</code> on the terminal command line if you are using the Drill Sandbox; otherwise, see <a href="/docs/starting-stopping-drill">Starting/Stopping Drill</a>.</p></li>
+<li><p>Use the <code>maprdb</code> storage plugin, which includes the <a href="/docs/mapr-db-format">MapR-DB format</a>, if you are using the Drill Sandbox; otherwise, enable and use the hbase storage plugin on a system having HBase services. </p>
+<div class="highlight"><pre><code class="language-text" data-lang="text"> USE hbase; /* If you have installed HBase services. */ 
 </code></pre></div></li>
-<li><p>Issue <code>exit</code> to leave the <code>hbase shell</code>.</p></li>
-<li><p>Start Drill. Refer to <a href="/docs/starting-stopping-drill">Starting/Stopping Drill</a> for instructions.</p></li>
-<li><p>Use Drill to issue the following SQL queries on the “students” and “clicks” tables:  </p>
+</ol>
 
-<ol>
-<li><p>Issue the following query to see the data in the “students” table:  </p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT * FROM hbase.`students`;
-</code></pre></div>
-<p>The query returns binary results:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">Query finished, fetching results ...
-+----------+----------+----------+-----------+----------+----------+----------+-----------+
-|id    | name        | state       | street      | zipcode |`
-+----------+----------+----------+-----------+----------+-----------+----------+-----------
-| [B@1ee37126 | [B@661985a1 | [B@15944165 | [B@385158f4 |[B@3e08d131 |
-| [B@64a7180e | [B@161c72c2 | [B@25b229e5 | [B@53dc8cb8 |[B@1d11c878 |
-| [B@349aaf0b | [B@175a1628 | [B@1b64a812 | [B@6d5643ca |[B@147db06f |
-| [B@3a7cbada | [B@52cf5c35 | [B@2baec60c | [B@5f4c543b |[B@2ec515d6 |
-</code></pre></div>
-<p>Since Drill does not require metadata, you must use the SQL <code>CAST</code> function in
-some queries to get readable query results.</p></li>
-<li><p>Issue the following query, that includes the <code>CAST</code> function, to see the data in the “<code>students</code>” table:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(students.clickinfo.studentid as VarChar(20)),
-CAST(students.account.name as VarChar(20)), CAST (students.address.state as
-VarChar(20)), CAST (students.address.street as VarChar(20)), CAST
-(students.address.zipcode as VarChar(20)), FROM hbase.students;
-</code></pre></div>
-<p><strong>Note:</strong> Use the following format when you query a column in an HBase table:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text"> tablename.columnfamilyname.columnname
+<p>Or:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">     USE maprdb; /* If you are using the Drill Sandbox */
 </code></pre></div>
-<p>For more information about column families, refer to <a href="http://hbase.apache.org/book/columnfamily.html">5.6. Column
-Family</a>.</p>
+<p>The <code>maprdb</code> storage plugin provides access to the <code>/tables</code> directory. Use Drill to query the students and clicks tables on the Drill Sandbox.  </p>
 
-<p>The query returns the data:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">Query finished, fetching results ...
-+----------+-------+-------+------------------+---------+`
-| studentid | name  | state | street           | zipcode |`
-+----------+-------+-------+------------------+---------+`
-| student1 | Alice | CA    | 123 Ballmer Av   | 12345   |`
-| student2 | Bob   | CA    | 1 Infinite Loop  | 12345   |`
-| student3 | Frank | CA    | 435 Walker Ct    | 12345   |`
-| student4 | Mary  | CA    | 56 Southern Pkwy | 12345   |`
-+----------+-------+-------+------------------+---------+`
-</code></pre></div></li>
-<li><p>Issue the following query on the “clicks” table to find out which students clicked on google.com:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">  SELECT CAST(clicks.clickinfo.studentid as VarChar(200)), CAST(clicks.clickinfo.url as VarChar(200)) FROM hbase.`clicks` WHERE URL LIKE &#39;%google%&#39;;  
-</code></pre></div>
-<p>The query returns the data:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">Query finished, fetching results ...`
+<h2 id="query-hbase-tables">Query HBase Tables</h2>
+
+<ol>
+<li><p>Issue the following query to see the data in the students table:  </p>
 
-+---------+-----------+-------------------------------+-----------------------+----------+----------+
-| clickid | studentid | time                          | url                   | itemtype | quantity |
-+---------+-----------+-------------------------------+-----------------------+----------+----------+
-| click1  | student1  | 2014-01-01 12:01:01.000100000 | http://www.google.com | image    | 1        |
-| click3  | student2  | 2014-01-01 01:02:01.000100000 | http://www.google.com | text     | 2        |
-| click6  | student3  | 2013-02-01 12:01:01.000100000 | http://www.google.com | image    | 1        |
-+---------+-----------+-------------------------------+-----------------------+----------+----------+
+<p>SELECT * FROM students;
+The query returns binary results:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">+------------+------------+------------+
+|  row_key   |  account   |  address   |
++------------+------------+------------+
+| [B@e6d9eb7 | {&quot;name&quot;:&quot;QWxpY2U=&quot;} | {&quot;state&quot;:&quot;Q0E=&quot;,&quot;street&quot;:&quot;MTIzIEJhbGxtZXIgQXY=&quot;,&quot;zipcode&quot;:&quot;MTIzNDU=&quot;} |
+| [B@2823a2b4 | {&quot;name&quot;:&quot;Qm9i&quot;} | {&quot;state&quot;:&quot;Q0E=&quot;,&quot;street&quot;:&quot;MSBJbmZpbml0ZSBMb29w&quot;,&quot;zipcode&quot;:&quot;MTIzNDU=&quot;} |
+| [B@3b8eec02 | {&quot;name&quot;:&quot;RnJhbms=&quot;} | {&quot;state&quot;:&quot;Q0E=&quot;,&quot;street&quot;:&quot;NDM1IFdhbGtlciBDdA==&quot;,&quot;zipcode&quot;:&quot;MTIzNDU=&quot;} |
+| [B@242895da | {&quot;name&quot;:&quot;TWFyeQ==&quot;} | {&quot;state&quot;:&quot;Q0E=&quot;,&quot;street&quot;:&quot;NTYgU291dGhlcm4gUGt3eQ==&quot;,&quot;zipcode&quot;:&quot;MTIzNDU=&quot;} |
++------------+------------+------------+
+4 rows selected (1.335 seconds)
+</code></pre></div>
+<p>The Drill output reflects the actual data type of the HBase data, which is binary.</p></li>
+<li><p>Issue the following query, that includes the CONVERT_FROM function, to convert the <code>students</code> table to readable data:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text"> SELECT CONVERT_FROM(row_key, &#39;UTF8&#39;) AS studentid, 
+        CONVERT_FROM(students.account.name, &#39;UTF8&#39;) AS name, 
+        CONVERT_FROM(students.address.state, &#39;UTF8&#39;) AS state, 
+        CONVERT_FROM(students.address.street, &#39;UTF8&#39;) AS street, 
+        CONVERT_FROM(t.students.address.zipcode, &#39;UTF8&#39;) AS zipcode 
+ FROM students;
+</code></pre></div>
+<p><strong>Note:</strong> Use dot notation to drill down to a column in an HBase table:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">tablename.columnfamilyname.columnnname
+</code></pre></div>
+<p>The query returns readable data:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">+------------+------------+------------+------------+------------+
+| studentid  |    name    |   state    |   street   |  zipcode   |
++------------+------------+------------+------------+------------+
+| student1   | Alice      | CA         | 123 Ballmer Av | 12345      |
+| student2   | Bob        | CA         | 1 Infinite Loop | 12345      |
+| student3   | Frank      | CA         | 435 Walker Ct | 12345      |
+| student4   | Mary       | CA         | 56 Southern Pkwy | 12345      |
++------------+------------+------------+------------+------------+
+4 rows selected (0.504 seconds)
+</code></pre></div></li>
+<li><p>Query the clicks table to see which students visited google.com:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONVERT_FROM(row_key, &#39;UTF8&#39;) AS clickid, 
+       CONVERT_FROM(clicks.clickinfo.studentid, &#39;UTF8&#39;) AS studentid, 
+       CONVERT_FROM(clicks.clickinfo.`time`, &#39;UTF8&#39;) AS `time`,
+       CONVERT_FROM(clicks.clickinfo.url, &#39;UTF8&#39;) AS url 
+FROM clicks WHERE clicks.clickinfo.url LIKE &#39;%google%&#39;; 
+
++------------+------------+------------+------------+
+|  clickid   | studentid  |    time    |    url     |
++------------+------------+------------+------------+
+| click1     | student1   | 2014-01-01 12:01:01.0001 | http://www.google.com |
+| click3     | student2   | 2014-01-01 01:02:01.0001 | http://www.google.com |
+| click6     | student3   | 2013-02-01 12:01:01.0001 | http://www.google.com |
++------------+------------+------------+------------+
+3 rows selected (0.294 seconds)
 </code></pre></div></li>
-</ol></li>
 </ol>
 </div>
 

Modified: drill/site/trunk/content/drill/docs/sql-functions/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/sql-functions/index.html?rev=1671710&r1=1671709&r2=1671710&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/sql-functions/index.html (original)
+++ drill/site/trunk/content/drill/docs/sql-functions/index.html Mon Apr  6 22:50:22 2015
@@ -70,454 +70,13 @@
 <div class="int_text" align="left"><p>You can use the following types of functions in your Drill queries:</p>
 
 <ul>
-<li>Math Functions</li>
-<li>Trig Functions</li>
-<li>String Functions</li>
-<li>Date/Time Functions</li>
-<li>Data Type Formatting Functions</li>
-<li>Aggregate Functions</li>
-<li>Aggregate Statistics Functions</li>
-<li>Convert and Cast Functions</li>
-<li>Nested Data Functions</li>
-</ul>
-
-<h2 id="string-functions">String Functions</h2>
-
-<p>The following table provides the string functions that you can use in your
-Drill queries:</p>
-
-<table><thead>
-<tr>
-<th>Function</th>
-<th>Return Type</th>
-</tr>
-</thead><tbody>
-<tr>
-<td>char_length(string) or character_length(string)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>concat(str &quot;any&quot; [, str &quot;any&quot; [, ...] ])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>convert_from(string text, src_encoding name)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>convert_to(string text, dest_encoding name)</td>
-<td>byte array</td>
-</tr>
-<tr>
-<td>initcap(string)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>left(str text, n int)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>length(string)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>length(string bytes, encoding name )</td>
-<td>int</td>
-</tr>
-<tr>
-<td>lower(string)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>lpad(string text, length int [, fill text])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>ltrim(string text [, characters text])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>position(substring in string)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>regexp_replace(string text, pattern text, replacement text [, flags text])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>replace(string text, from text, to text)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>right(str text, n int)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>rpad(string text, length int [, fill text])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>rtrim(string text [, characters text])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>strpos(string, substring)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>substr(string, from [, count])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>substring(string [from int] [for int])</td>
-<td>text</td>
-</tr>
-<tr>
-<td>trim([leading</td>
-<td>trailing</td>
-</tr>
-<tr>
-<td>upper(string)</td>
-<td>text</td>
-</tr>
-</tbody></table>
-
-<h2 id="date/time-functions">Date/Time Functions</h2>
-
-<p>The following table provides the date/time functions that you can use in your
-Drill queries:</p>
-
-<table><thead>
-<tr>
-<th><strong>Function</strong></th>
-<th><strong>Return Type</strong></th>
-</tr>
-</thead><tbody>
-<tr>
-<td>current_date</td>
-<td>date</td>
-</tr>
-<tr>
-<td>current_time</td>
-<td>time with time zone</td>
-</tr>
-<tr>
-<td>current_timestamp</td>
-<td>timestamp with time zone</td>
-</tr>
-<tr>
-<td>date_add(date,interval expr type)</td>
-<td>date/datetime</td>
-</tr>
-<tr>
-<td>date_part(text, timestamp)</td>
-<td>double precision</td>
-</tr>
-<tr>
-<td>date_part(text, interval)</td>
-<td>double precision</td>
-</tr>
-<tr>
-<td>date_sub(date,INTERVAL expr type)</td>
-<td>date/datetime</td>
-</tr>
-<tr>
-<td>extract(field from interval)</td>
-<td>double precision</td>
-</tr>
-<tr>
-<td>extract(field from timestamp)</td>
-<td>double precision</td>
-</tr>
-<tr>
-<td>localtime</td>
-<td>time</td>
-</tr>
-<tr>
-<td>localtimestamp</td>
-<td>timestamp</td>
-</tr>
-<tr>
-<td>now()</td>
-<td>timestamp with time zone</td>
-</tr>
-<tr>
-<td>timeofday()</td>
-<td>text</td>
-</tr>
-</tbody></table>
-
-<h2 id="data-type-formatting-functions">Data Type Formatting Functions</h2>
-
-<p>The following table provides the data type formatting functions that you can
-use in your Drill queries:</p>
-
-<table><thead>
-<tr>
-<th><strong>Function</strong></th>
-<th><strong>Return Type</strong></th>
-</tr>
-</thead><tbody>
-<tr>
-<td>to_char(timestamp, text)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>to_char(int, text)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>to_char(double precision, text)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>to_char(numeric, text)</td>
-<td>text</td>
-</tr>
-<tr>
-<td>to_date(text, text)</td>
-<td>date</td>
-</tr>
-<tr>
-<td>to_number(text, text)</td>
-<td>numeric</td>
-</tr>
-<tr>
-<td>to_timestamp(text, text)</td>
-<td>timestamp with time zone</td>
-</tr>
-<tr>
-<td>to_timestamp(double precision)</td>
-<td>timestamp with time zone</td>
-</tr>
-</tbody></table>
-
-<h2 id="aggregate-functions">Aggregate Functions</h2>
-
-<p>The following table provides the aggregate functions that you can use in your
-Drill queries:</p>
-
-<table><thead>
-<tr>
-<th><strong>Function</strong></th>
-<th><strong>Argument Type</strong></th>
-<th><strong>Return Type</strong></th>
-</tr>
-</thead><tbody>
-<tr>
-<td>avg(expression)</td>
-<td>smallint, int, bigint, real, double precision, numeric, or interval</td>
-<td>numeric for any integer-type argument, double precision for a floating-point argument, otherwise the same as the argument data type</td>
-</tr>
-<tr>
-<td>count(*)</td>
-<td><em>-</em></td>
-<td>bigint</td>
-</tr>
-<tr>
-<td>count([DISTINCT] expression)</td>
-<td>any</td>
-<td>bigint</td>
-</tr>
-<tr>
-<td>max(expression)</td>
-<td>any array, numeric, string, or date/time type</td>
-<td>same as argument type</td>
-</tr>
-<tr>
-<td>min(expression)</td>
-<td>any array, numeric, string, or date/time type</td>
-<td>same as argument type</td>
-</tr>
-<tr>
-<td>sum(expression)</td>
-<td>smallint, int, bigint, real, double precision, numeric, or interval</td>
-<td>bigint for smallint or int arguments, numeric for bigint arguments, double precision for floating-point arguments, otherwise the same as the argument data type</td>
-</tr>
-</tbody></table>
-
-<h2 id="aggregate-statistics-functions">Aggregate Statistics Functions</h2>
-
-<p>The following table provides the aggregate statistics functions that you can use in your Drill queries:</p>
-
-<table><thead>
-<tr>
-<th><strong>Function</strong></th>
-<th><strong>Argument Type</strong></th>
-<th><strong>Return Type</strong></th>
-</tr>
-</thead><tbody>
-<tr>
-<td>stddev(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-<tr>
-<td>stddev_pop(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-<tr>
-<td>stddev_samp(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-<tr>
-<td>variance(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-<tr>
-<td>var_pop(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-<tr>
-<td>var_samp(expression)</td>
-<td>smallint, int, bigint, real, double precision, or numeric</td>
-<td>double precision for floating-point arguments, otherwise numeric</td>
-</tr>
-</tbody></table>
-
-<h2 id="convert-and-cast-functions">Convert and Cast Functions</h2>
-
-<p>You can use the CONVERT_TO and CONVERT_FROM functions to encode and decode
-data when you query your data sources with Drill. For example, HBase stores
-data as encoded byte arrays (VARBINARY data). When you issue a query with the
-CONVERT_FROM function on HBase, Drill decodes the data and converts it to the
-specified data type. In instances where Drill sends data back to HBase during
-a query, you can use the CONVERT_TO function to change the data type to bytes.</p>
-
-<p>Do not use the CAST function for converting binary data types to other types. Although CAST works for converting VARBINARY to VARCHAR, CAST does not work in other cases. CONVERT functions not only work regardless of the types you are converting but are also more efficient to use than CAST when your data sources return binary data.</p>
-
-<p>The following table provides the data types that you use with the CONVERT_TO
-and CONVERT_FROM functions:</p>
-
-<table><thead>
-<tr>
-<th><strong>Type</strong></th>
-<th><strong>Input Type</strong></th>
-<th><strong>Output Type</strong></th>
-</tr>
-</thead><tbody>
-<tr>
-<td>BOOLEAN_BYTE</td>
-<td>bytes(1)</td>
-<td>boolean</td>
-</tr>
-<tr>
-<td>TINYINT_BE</td>
-<td>bytes(1)</td>
-<td>tinyint</td>
-</tr>
-<tr>
-<td>TINYINT</td>
-<td>bytes(1)</td>
-<td>tinyint</td>
-</tr>
-<tr>
-<td>SMALLINT_BE</td>
-<td>bytes(2)</td>
-<td>smallint</td>
-</tr>
-<tr>
-<td>SMALLINT</td>
-<td>bytes(2)</td>
-<td>smallint</td>
-</tr>
-<tr>
-<td>INT_BE</td>
-<td>bytes(4)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>INT</td>
-<td>bytes(4)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>BIGINT_BE</td>
-<td>bytes(8)</td>
-<td>bigint</td>
-</tr>
-<tr>
-<td>BIGINT</td>
-<td>bytes(8)</td>
-<td>bigint</td>
-</tr>
-<tr>
-<td>FLOAT</td>
-<td>bytes(4)</td>
-<td>float (float4)</td>
-</tr>
-<tr>
-<td>DOUBLE</td>
-<td>bytes(8)</td>
-<td>double (float8)</td>
-</tr>
-<tr>
-<td>INT_HADOOPV</td>
-<td>bytes(1-9)</td>
-<td>int</td>
-</tr>
-<tr>
-<td>BIGINT_HADOOPV</td>
-<td>bytes(1-9)</td>
-<td>bigint</td>
-</tr>
-<tr>
-<td>DATE_EPOCH_BE</td>
-<td>bytes(8)</td>
-<td>date</td>
-</tr>
-<tr>
-<td>DATE_EPOCH</td>
-<td>bytes(8)</td>
-<td>date</td>
-</tr>
-<tr>
-<td>TIME_EPOCH_BE</td>
-<td>bytes(8)</td>
-<td>time</td>
-</tr>
-<tr>
-<td>TIME_EPOCH</td>
-<td>bytes(8)</td>
-<td>time</td>
-</tr>
-<tr>
-<td>UTF8</td>
-<td>bytes</td>
-<td>varchar</td>
-</tr>
-<tr>
-<td>UTF16</td>
-<td>bytes</td>
-<td>var16char</td>
-</tr>
-<tr>
-<td>UINT8</td>
-<td>bytes(8)</td>
-<td>uint8</td>
-</tr>
-</tbody></table>
-
-<p>A common use case for CONVERT_FROM is when a data source embeds complex data
-inside a column. For example, you may have an HBase or MapR-DB table with
-embedded JSON data:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">select CONVERT_FROM(col1, &#39;JSON&#39;) 
-FROM hbase.table1
-...
-</code></pre></div>
-<h2 id="nested-data-functions">Nested Data Functions</h2>
-
-<p>This section contains descriptions of SQL functions that you can use to
-analyze nested data:</p>
-
-<ul>
-<li><a href="/docs/flatten-function">FLATTEN Function</a></li>
-<li><a href="/docs/kvgen-function">KVGEN Function</a></li>
-<li><a href="/docs/repeated-count-function">REPEATED_COUNT Function</a></li>
+<li><a href="/docs/math-and-trig/">Math and Trig</a></li>
+<li><a href="/docs/casting-converting-data-types/">Casting and Converting Data Types</a></li>
+<li><a href="/docs/date-time-functions-and-arithmetic/">Date/Time and Arithmetic</a></li>
+<li><a href="/docs/string-manipulation">String Manipulation</a></li>
+<li><a href="">Aggregate and Aggregate Statistics</a></li>
+<li><a href="/docs/nested-data-functions/">Nested Data</a></li>
+<li><a href="">Other functions</a></li>
 </ul>
 </div>
 

Added: drill/site/trunk/content/drill/docs/string-manipulation/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/string-manipulation/index.html?rev=1671710&view=auto
==============================================================================
--- drill/site/trunk/content/drill/docs/string-manipulation/index.html (added)
+++ drill/site/trunk/content/drill/docs/string-manipulation/index.html Mon Apr  6 22:50:22 2015
@@ -0,0 +1,506 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+
+<meta charset="UTF-8">
+
+
+<title>String Manipulation - Apache Drill</title>
+
+<link href="/css/syntax.css" rel="stylesheet" type="text/css">
+<link href="/css/style.css" rel="stylesheet" type="text/css">
+<link href="/css/arrows.css" rel="stylesheet" type="text/css">
+<link href="/css/button.css" rel="stylesheet" type="text/css">
+
+<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+<link rel="icon" href="/favicon.ico" type="image/x-icon">
+
+<script language="javascript" type="text/javascript" src="/js/lib/jquery-1.11.1.min.js"></script>
+<script language="javascript" type="text/javascript" src="/js/lib/jquery.easing.1.3.js"></script>
+<script language="javascript" type="text/javascript" src="/js/modernizr.custom.js"></script>
+<script language="javascript" type="text/javascript" src="/js/script.js"></script>
+
+</head>
+
+<body onResize="resized();">
+
+<div class="bui"></div>
+
+<div id="search">
+<input type="text" placeholder="Enter search term here">
+</div>
+
+<div id="menu" class="mw">
+<ul>
+  <li class="logo"><a href="/"></a></li>
+  <li>
+    <a href="/overview/">Documentation</a>
+    <ul>
+      <li><a href="/overview/">Overview&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
+      <li><a href="http://drill.apache.org/docs/apache-drill-in-10-minutes/" target="_blank">Drill in 10 Minutes</a></li>
+      <li><a href="/why/">Why Drill? &nbsp;&nbsp;&nbsp;&nbsp;</a></li>
+      <li><a href="/architecture/">Architecture</a></li>
+    </ul>
+  </li>
+  <li>
+    <a href="/community/">Community</a>
+    <ul>
+      <li><a href="/team/">Team</a></li>
+      <li><a href="/community/#events">Events and Meetups</a></li>
+      <li><a href="/community/#mailinglists">Mailing Lists</a></li>
+      <li><a href="/community/#getinvolved">Get Involved</a></li>
+      <li><a href="https://issues.apache.org/jira/browse/DRILL/" target="_blank">Issue Tracker</a></li>
+      <li><a href="https://github.com/apache/drill" target="_blank">GitHub</a></li>
+    </ul>
+  </li>
+  <li><a href="/faq/">FAQ</a></li>
+  <li><a href="/blog/">Blog</a></li>
+  <li style="width:30px; padding-left: 2px; padding-right:10px"><a href="https://twitter.com/apachedrill" target="_blank"><img src="/images/twitterbw.png" alt="" align="center" width="22" style="padding: 0px 10px 1px 0px;"></a> </li>
+  <li class="l"><span>&nbsp;</span></li>
+  <li class="d"><a href="/download/">Download</a></li>
+</ul>
+</div>
+
+<div class="int_title">
+<h1>String Manipulation</h1>
+
+</div>
+
+<div class="int_text" align="left"><p>You can use the following string functions in Drill queries:</p>
+
+<table><thead>
+<tr>
+<th>Function</th>
+<th>Return Type</th>
+</tr>
+</thead><tbody>
+<tr>
+<td><a href="/docs/string-manipulation#byte_substr">BYTE_SUBSTR(string, start [, length])</a></td>
+<td>byte array or text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#char_length">CHAR_LENGTH(string) or character_length(string)</a></td>
+<td>int</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#concat">CONCAT(str &quot;any&quot; [, str &quot;any&quot; [, ...] ])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#initcap">INITCAP(string)</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#length">LENGTH(string [, encoding name ])</a></td>
+<td>int</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#lower">LOWER(string)</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#lpad">LPAD(string, length [, fill])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#ltrim">LTRIM(string [, characters])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#position">POSITION(substring in string)</a></td>
+<td>int</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#regexp_replace">REGEXP_REPLACE(string, pattern, replacement</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#rpad">RPAD(string, length [, fill ])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#rtrim">RTRIM(string [, characters])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#strpos">STRPOS(string, substring)</a></td>
+<td>int</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#substr">SUBSTR(string, from [, count])</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#trim">TRIM([position_option] [characters] from string)</a></td>
+<td>text</td>
+</tr>
+<tr>
+<td><a href="/docs/string-manipulation#upper">UPPER(string)</a></td>
+<td>text</td>
+</tr>
+</tbody></table>
+
+<h2 id="byte_substr">BYTE_SUBSTR</h2>
+
+<p>Returns in binary format a substring of a string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">BYTE_SUBSTR( string-expression, start  [, length [(string-expression)]] );
+</code></pre></div>
+<p><em>string-expression</em> is the entire string, a column name having string values for example.
+<em>start</em> is a start position in the string. 1 is the first position.
+<em>length</em> is the number of characters to the right of the start position to include in the output expressed in either of the following ways:
+* As an integer. For example, 19 includes 19 characters to the right of the start position in the output.
+* AS length(string-expression). For example, length(my_string) includes the number of characters in my_string minus the number of the start position.</p>
+
+<h3 id="usage-notes">Usage Notes</h3>
+
+<p>Combine the use of BYTE_SUBSTR and CONVERT_FROM to separate parts of a HBase composite key for example. </p>
+
+<h3 id="examples">Examples</h3>
+
+<p>A composite HBase row key consists of strings followed by a reverse timestamp (long). For example: AMZN_9223370655563575807. Use BYTE_SUBSTR and CONVERT_FROM to separate parts of a HBase composite key.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONVERT_FROM(BYTE_SUBSTR(row_key,6,19),&#39;UTF8&#39;) FROM root.`mydata` LIMIT 1;
++---------------------+
+|       EXPR$0        |
++---------------------+
+| 9223370655563575807 |
++---------------------+
+1 rows selected (0.271 seconds)
+
+SELECT CONVERT_FROM(BYTE_SUBSTR(row_key,6,length(row_key)),&#39;UTF8&#39;) FROM root.`mydata` LIMIT 1;
++---------------------+
+|       EXPR$0        |
++---------------------+
+| 9223370655563575807 |
++---------------------+
+1 rows selected (0.271 seconds)
+</code></pre></div>
+<h2 id="char_length">CHAR_LENGTH</h2>
+
+<p>Returns the number of characters in a string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">( CHAR_LENGTH | CHARACTER_LENGTH ) (string);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CHAR_LENGTH(&#39;Drill rocks&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| 11         |
++------------+
+1 row selected (0.127 seconds)
+</code></pre></div>
+<h2 id="concat">CONCAT</h2>
+
+<p>Concatenates arguments.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">CONCAT(string [, string [, ...] );
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONCAT(&#39;Drill&#39;, &#39; &#39;, 1.0, &#39; &#39;, &#39;release&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| Drill 1.0 release |
++------------+
+1 row selected (0.221 seconds)
+</code></pre></div>
+<p>Alternatively, you can use the <a href="/docs/operators#string-concatenate-operator">string concatenation operation</a> to concatenate strings.</p>
+
+<h2 id="initcap">INITCAP</h2>
+
+<p>Returns the string using initial caps.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">INITCAP(string);
+</code></pre></div>
+<h3 id="examples">Examples</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT INITCAP(&#39;apache drill release 1.0&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| Apache Drill Release 1.0 |
++------------+
+1 row selected (0.124 seconds)
+</code></pre></div>
+<h2 id="length">LENGTH</h2>
+
+<p>Returns the number of characters in the string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">LENGTH( string [, encoding] );
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT LENGTH(&#39;apache drill release 1.0&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| 24         |
++------------+
+1 row selected (0.127 seconds)
+
+SELECT LENGTH(row_key, &#39;UTF8&#39;) FROM root.`students`;
+
++------------+
+|   EXPR$0   |
++------------+
+| 8          |
+| 8          |
+| 8          |
+| 8          |
++------------+
+4 rows selected (0.259 seconds)
+</code></pre></div>
+<h2 id="lower">LOWER</h2>
+
+<p>Converts characters in the string to lower case.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">LOWER (string);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT LOWER(&#39;Apache Drill&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| apache drill |
++------------+
+1 row selected (0.113 seconds)
+</code></pre></div>
+<h2 id="lpad">LPAD</h2>
+
+<p>Pads the string to the length specified by prepending the fill or a space. Truncates the string if longer than the specified length.
+. </p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">LPAD (string, length [, fill text]);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT LPAD(&#39;Release 1.0&#39;, 27, &#39;of Apache Drill 1.0&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| of Apache Drill Release 1.0 |
++------------+
+1 row selected (0.112 seconds)
+</code></pre></div>
+<h2 id="ltrim">LTRIM</h2>
+
+<p>Removes the longest string having only characters specified in the second argument string from the beginning of the string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">LTRIM(string, string);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT LTRIM(&#39;Apache Drill&#39;, &#39;Apache &#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| Drill      |
++------------+
+1 row selected (0.131 seconds)
+</code></pre></div>
+<h2 id="position">POSITION</h2>
+
+<p>Returns the location of a substring.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">POSITION(&#39;substring&#39; in &#39;string&#39;)
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT POSITION(&#39;c&#39; in &#39;Apache Drill&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| 4          |
++------------+
+1 row selected (0.12 seconds)
+</code></pre></div>
+<h2 id="regexp_replace">REGEXP_REPLACE</h2>
+
+<p>Substitutes new text for substrings that match POSIX regular expression patterns.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">REGEXP_REPLACE(source_char, pattern, replacement);
+</code></pre></div>
+<p><em>source</em> is the character expression to be replaced.</p>
+
+<p><em>pattern</em> is the regular expression.</p>
+
+<p><em>replacement</em> is the string to substitute for the source.</p>
+
+<h3 id="examples">Examples</h3>
+
+<p>Flatten and replace a&#39;s with b&#39;s in this JSON data.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">{&quot;id&quot;:1,&quot;strs&quot;:[&quot;abc&quot;,&quot;acd&quot;]}
+{&quot;id&quot;:2,&quot;strs&quot;:[&quot;ade&quot;,&quot;aef&quot;]}
+
+SELECT id, REGEXP_REPLACE(FLATTEN(strs), &#39;a&#39;,&#39;b&#39;) FROM tmp.`regex-flatten.json`;
+
++------------+------------+
+|     id     |   EXPR$1   |
++------------+------------+
+| 1          | bbc        |
+| 1          | bcd        |
+| 2          | bde        |
+| 2          | bef        |
++------------+------------+
+4 rows selected (0.186 seconds)
+</code></pre></div>
+<p>Use the regular expression a. in the same query to replace all a&#39;s and the subsequent character.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT ID, REGEXP_REPLACE(FLATTEN(strs), &#39;a.&#39;,&#39;b&#39;) FROM tmp.`regex-flatten.json`;
+
++------------+------------+
+|     id     |   EXPR$1   |
++------------+------------+
+| 1          | bc         |
+| 1          | bd         |
+| 2          | be         |
+| 2          | bf         |
++------------+------------+
+4 rows selected (0.132 seconds)
+</code></pre></div>
+<h2 id="rpad">RPAD</h2>
+
+<p>Pads the string to the length specified by appending the fill or a space. Truncates the string if longer than the specified length.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">RPAD (string, length [, fill text]);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT RPAD(&#39;Apache Drill &#39;, 22, &#39;Release 1.0&#39;) FROM sys.drillbits;
++------------+
+|   EXPR$0   |
++------------+
+| Apache Drill Release 1 |
++------------+
+1 row selected (0.15 seconds)
+</code></pre></div>
+<h2 id="rtrim">RTRIM</h2>
+
+<p>Removes the longest string having only characters specified in the second argument string from the end of the string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">RTRIM(string, string);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT RTRIM(&#39;Apache Drill&#39;, &#39;Drill &#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| Apache     |
++------------+
+1 row selected (0.135 seconds)
+</code></pre></div>
+<h2 id="strpos">STRPOS</h2>
+
+<p>Returns the location of the substring in a string.</p>
+
+<h3 id="syntax">Syntax</h3>
+
+<p>STRPOS(string, substring)</p>
+
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT STRPOS(&#39;Apache Drill&#39;, &#39;Drill&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| 8          |
++------------+
+1 row selected (0.22 seconds)
+</code></pre></div>
+<h2 id="substr">SUBSTR</h2>
+
+<p>Extracts characters from position 1 - x of the string an optional y times.</p>
+
+<h3 id="syntax">Syntax</h3>
+
+<p>(SUBSTR | SUBSTRING)(string, x, y)</p>
+
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT SUBSTR(&#39;Apache Drill&#39;, 8) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| Drill      |
++------------+
+1 row selected (0.134 seconds)
+
+SELECT SUBSTR(&#39;Apache Drill&#39;, 3, 2) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| ac         |
++------------+
+1 row selected (0.129 seconds)
+</code></pre></div>
+<h2 id="trim">TRIM</h2>
+
+<p>Removes the longest string having only the characters from the beginning, end, or both ends of the string.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">TRIM ([leading | trailing | both] [characters] from string)
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TRIM(trailing &#39;l&#39; from &#39;Drill&#39;) FROM sys.drillbits;
++------------+
+|   EXPR$0   |
++------------+
+| Dri        |
++------------+
+1 row selected (0.172 seconds)
+</code></pre></div>
+<h2 id="upper">UPPER</h2>
+
+<p>Converts characters in the string to lower case.</p>
+
+<h3 id="syntax">Syntax</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">UPPER (string);
+</code></pre></div>
+<h3 id="example">Example</h3>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT UPPER(&#39;Apache Drill&#39;) FROM sys.drillbits;
+
++------------+
+|   EXPR$0   |
++------------+
+| APACHE DRILL |
++------------+
+1 row selected (0.104 seconds)
+</code></pre></div></div>
+
+
+<div id="footer" class="mw">
+<div class="wrapper">
+Copyright © 2012-2014 The Apache Software Foundation, licensed under the Apache License, Version 2.0.<br>
+Apache and the Apache feather logo are trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.<br/><br/>
+</div>
+</div>
+
+<script>
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ga('create', 'UA-53379651-1', 'auto');
+ga('send', 'pageview');
+</script>
+
+</body>
+</html>

Modified: drill/site/trunk/content/drill/feed.xml
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/feed.xml?rev=1671710&r1=1671709&r2=1671710&view=diff
==============================================================================
--- drill/site/trunk/content/drill/feed.xml (original)
+++ drill/site/trunk/content/drill/feed.xml Mon Apr  6 22:50:22 2015
@@ -6,8 +6,8 @@
 </description>
     <link>/</link>
     <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
-    <pubDate>Fri, 03 Apr 2015 16:57:09 -0700</pubDate>
-    <lastBuildDate>Fri, 03 Apr 2015 16:57:09 -0700</lastBuildDate>
+    <pubDate>Mon, 06 Apr 2015 15:47:31 -0700</pubDate>
+    <lastBuildDate>Mon, 06 Apr 2015 15:47:31 -0700</lastBuildDate>
     <generator>Jekyll v2.5.2</generator>
     
       <item>