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/13 23:52:51 UTC

svn commit: r1673293 [1/2] - in /drill/site/trunk/content/drill: ./ docs/ docs/aggregate-and-aggregate-statistical/ docs/data-type-conversion/ docs/data-types/ docs/date-time-and-timestamp/ docs/date-time-functions-and-arithmetic/ docs/functions-for-ha...

Author: bridgetb
Date: Mon Apr 13 21:52:51 2015
New Revision: 1673293

URL: http://svn.apache.org/r1673293
Log:
DRILL-2736: review feedback on functions

Modified:
    drill/site/trunk/content/drill/docs/aggregate-and-aggregate-statistical/index.html
    drill/site/trunk/content/drill/docs/data-type-conversion/index.html
    drill/site/trunk/content/drill/docs/data-types/index.html
    drill/site/trunk/content/drill/docs/date-time-and-timestamp/index.html
    drill/site/trunk/content/drill/docs/date-time-functions-and-arithmetic/index.html
    drill/site/trunk/content/drill/docs/functions-for-handling-nulls/index.html
    drill/site/trunk/content/drill/docs/handling-different-data-types/index.html
    drill/site/trunk/content/drill/docs/img/loginSandBox.png
    drill/site/trunk/content/drill/docs/img/vbApplSettings.png
    drill/site/trunk/content/drill/docs/img/vbGenSettings.png
    drill/site/trunk/content/drill/docs/img/vbImport.png
    drill/site/trunk/content/drill/docs/img/vbNetwork.png
    drill/site/trunk/content/drill/docs/img/vbloginSandBox.png
    drill/site/trunk/content/drill/docs/img/vmLibrary.png
    drill/site/trunk/content/drill/docs/img/vmShare.png
    drill/site/trunk/content/drill/docs/index.html
    drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-virtualbox/index.html
    drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-vmware-player-vmware-fusion/index.html
    drill/site/trunk/content/drill/docs/lexical-structure/index.html
    drill/site/trunk/content/drill/docs/persistent-configuration-storage/index.html
    drill/site/trunk/content/drill/docs/planning-and-execution-options/index.html
    drill/site/trunk/content/drill/docs/start-up-options/index.html
    drill/site/trunk/content/drill/docs/string-manipulation/index.html
    drill/site/trunk/content/drill/feed.xml

Modified: drill/site/trunk/content/drill/docs/aggregate-and-aggregate-statistical/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/aggregate-and-aggregate-statistical/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/aggregate-and-aggregate-statistical/index.html (original)
+++ drill/site/trunk/content/drill/docs/aggregate-and-aggregate-statistical/index.html Mon Apr 13 21:52:51 2015
@@ -111,7 +111,7 @@ Drill queries:</p>
 </tr>
 </tbody></table>
 
-<p>MIN, MAX, COUNT, AVG, SUM accept ALL and DISTINCT keywords. The default is ALL.</p>
+<p>MIN, MAX, COUNT, AVG, and SUM accept ALL and DISTINCT keywords. The default is ALL.</p>
 
 <h3 id="examples">Examples</h3>
 <div class="highlight"><pre><code class="language-text" data-lang="text">SELECT a2 FROM t2;

Modified: drill/site/trunk/content/drill/docs/data-type-conversion/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/data-type-conversion/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/data-type-conversion/index.html (original)
+++ drill/site/trunk/content/drill/docs/data-type-conversion/index.html Mon Apr 13 21:52:51 2015
@@ -77,7 +77,7 @@
 
 <h2 id="cast">CAST</h2>
 
-<p>The CAST function converts an expression from one type to another.</p>
+<p>The CAST function converts an entity, such as an expression that evaluates to a single value, from one type to another.</p>
 
 <h3 id="syntax">Syntax</h3>
 <div class="highlight"><pre><code class="language-text" data-lang="text">cast (&lt;expression&gt; AS &lt;data type&gt;)
@@ -106,7 +106,7 @@
 
 <h3 id="examples">Examples</h3>
 
-<p>The following examples show how to cast a string to a number, a number to a string, and one numerical type to another.</p>
+<p>The following examples show how to cast a string to a number, a number to a string, and one type of number to another.</p>
 
 <h4 id="casting-a-character-string-to-a-number">Casting a character string to a number</h4>
 
@@ -122,16 +122,8 @@
 </code></pre></div>
 <h4 id="casting-a-number-to-a-character-string">Casting a number to a character string</h4>
 
-<p>The first example shows that Drill uses a default limit of 1 character if you omit the VARCHAR limit: The result is truncated to 1 character.  The second example casts the same number to a VARCHAR having a limit of 3 characters: The result is a 3-character string, 456. The third example shows that you can use CHAR as an alias for VARCHAR. You can also use CHARACTER or CHARACTER VARYING.</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(456 as VARCHAR) FROM sys.version;
-+------------+
-|   EXPR$0   |
-+------------+
-| 4          |
-+------------+
-1 row selected (0.063 seconds)
-
-SELECT CAST(456 as VARCHAR(3)) FROM sys.version;
+<p>The first example shows Drill casting a number to a VARCHAR having a length of 3 bytes: The result is a 3-character string, 456. Drill supports the CHAR and CHARACTER VARYING alias.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(456 as VARCHAR(3)) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
@@ -147,7 +139,7 @@ SELECT CAST(456 as CHAR(3)) FROM sys.ver
 +------------+
 1 row selected (0.093 seconds)
 </code></pre></div>
-<h4 id="casting-from-one-numerical-type-to-another">Casting from one numerical type to another</h4>
+<h4 id="casting-from-one-type-of-number-to-another">Casting from one type of number to another</h4>
 
 <p>Cast an integer to a decimal.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(-2147483648 AS DECIMAL(28,8)) FROM sys.version;
@@ -165,17 +157,29 @@ SELECT CAST(456 as CHAR(3)) FROM sys.ver
 CAST (column_name AS INTERVAL DAY)
 CAST (column_name AS INTERVAL YEAR)
 </code></pre></div>
-<p>For example, a JSON file contains the following objects:</p>
+<p>For example, a JSON file named intervals.json contains the following objects:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">{ &quot;INTERVALYEAR_col&quot;:&quot;P1Y&quot;, &quot;INTERVALDAY_col&quot;:&quot;P1D&quot;, &quot;INTERVAL_col&quot;:&quot;P1Y1M1DT1H1M&quot; }
 { &quot;INTERVALYEAR_col&quot;:&quot;P2Y&quot;, &quot;INTERVALDAY_col&quot;:&quot;P2D&quot;, &quot;INTERVAL_col&quot;:&quot;P2Y2M2DT2H2M&quot; }
 { &quot;INTERVALYEAR_col&quot;:&quot;P3Y&quot;, &quot;INTERVALDAY_col&quot;:&quot;P3D&quot;, &quot;INTERVAL_col&quot;:&quot;P3Y3M3DT3H3M&quot; }
 </code></pre></div>
-<p>The following CTAS statement casts text from a JSON file to INTERVAL data types in a Parquet table:</p>
+<ol>
+<li><p>Set the storage format to Parquet.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">ALTER SESSION SET `store.format` = &#39;parquet&#39;;
+
++------------+------------+
+|     ok     |  summary   |
++------------+------------+
+| true       | store.format updated. |
++------------+------------+
+1 row selected (0.037 seconds)
+</code></pre></div></li>
+</ol>
+
+<p>Use a CTAS statement to cast text from a JSON file to year and day intervals and to write the data to a Parquet table:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">CREATE TABLE dfs.tmp.parquet_intervals AS 
-(SELECT cast (INTERVAL_col as interval),
-       cast( INTERVALYEAR_col as interval year) INTERVALYEAR_col, 
-       cast( INTERVALDAY_col as interval day) INTERVALDAY_col 
-FROM `/user/root/intervals.json`);
+(SELECT CAST( INTERVALYEAR_col as interval year) INTERVALYEAR_col, 
+        CAST( INTERVALDAY_col as interval day) INTERVALDAY_col 
+FROM dfs.`/Users/drill/intervals.json`);
 </code></pre></div>
 <!-- Text and include output -->
 
@@ -185,128 +189,13 @@ FROM `/user/root/intervals.json`);
 data to and from another data type.</p>
 
 <h2 id="syntax">Syntax</h2>
+<div class="highlight"><pre><code class="language-text" data-lang="text">CONVERT_TO (column, type)
 
-<p>CONVERT_TO (column, type)</p>
-
-<p>CONVERT_FROM(column, type)</p>
-
+CONVERT_FROM(column, type)
+</code></pre></div>
 <p><em>column</em> is the name of a column Drill reads.</p>
 
-<p><em>type</em> is one of the data types listed in the CONVERT_TO/FROM Data Types table.</p>
-
-<p>The following table provides the data types that you use with the CONVERT_TO
-and CONVERT_FROM functions:</p>
-
-<h3 id="convert_to/from-data-types">CONVERT_TO/FROM Data Types</h3>
-
-<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><em>type</em> is one of the data types listed in the <a href="/docs/data-types#convert_to-and-convert_from-data-types">CONVERT_TO/FROM Data Types</a> table.</p>
 
 <h3 id="usage-notes">Usage Notes</h3>
 
@@ -317,7 +206,7 @@ data as encoded VARBINARY data. To read
 
 <h2 id="usage-notes">Usage Notes</h2>
 
-<p>Use the CONVERT_TO function to change the data type to binary when sending data back to a binary data source, such as HBase, MapR, and Parquet, from a Drill query. CONVERT_TO also converts an SQL data type to complex types, including Hbase byte arrays, JSON and Parquet arrays, and maps. CONVERT_FROM converts from complex types, including Hbase arrays, JSON and Parquet arrays and maps to an SQL data type. </p>
+<p>Use the CONVERT_TO function to change the data type to binary when sending data back to a binary data source, such as HBase, MapR, and Parquet, from a Drill query. CONVERT_TO also converts an SQL data type to complex types, including HBase byte arrays, JSON and Parquet arrays, and maps. CONVERT_FROM converts from complex types, including HBase arrays, JSON and Parquet arrays and maps to an SQL data type. </p>
 
 <h3 id="examples">Examples</h3>
 
@@ -336,7 +225,7 @@ SELECT * FROM students;
 +------------+------------+------------+
 4 rows selected (1.335 seconds)
 </code></pre></div>
-<p>You use the CONVERT_FROM function to decode the binary data to render it readable:</p>
+<p>You use the CONVERT_FROM function to decode the binary data to render it readable, selecting a data type to use from the <a href="/docs/data-type-conversion/#convert_to-and-convert_from-data-types">list of supported types</a>. JSON supports strings. To convert binary to strings, use the UTF8 type.:</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, 
@@ -353,6 +242,33 @@ SELECT * FROM students;
 +------------+------------+------------+------------+------------+
 4 rows selected (0.504 seconds)
 </code></pre></div>
+<p>This example converts from VARCHAR to a JSON map:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONVERT_FROM(&#39;{x:100, y:215.6}&#39; ,&#39;JSON&#39;) AS MYCOL FROM sys.version;
++------------+
+|   MYCOL    |
++------------+
+| {&quot;x&quot;:100,&quot;y&quot;:215.6} |
++------------+
+1 row selected (0.073 seconds)
+</code></pre></div>
+<p>This example uses a list of BIGINT as input and returns a repeated list of vectors:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONVERT_FROM(&#39;[ [1, 2], [3, 4], [5]]&#39; ,&#39;JSON&#39;) AS MYCOL1 FROM sys.version;
++------------+
+|   mycol1   |
++------------+
+| [[1,2],[3,4],[5]] |
++------------+
+1 row selected (0.054 seconds)
+</code></pre></div>
+<p>This example uses a map as input to return a repeated list vector (JSON).</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CONVERT_FROM(&#39;[{a : 100, b: 200}, {a:300, b: 400}]&#39; ,&#39;JSON&#39;) AS MYCOL1  FROM sys.version;
++------------+
+|   MYCOL1   |
++------------+
+| [{&quot;a&quot;:100,&quot;b&quot;:200},{&quot;a&quot;:300,&quot;b&quot;:400}] |
++------------+
+1 row selected (0.074 seconds)
+</code></pre></div>
 <h4 id="set-up-a-storage-plugin-for-working-with-hbase-files">Set up a storage plugin for working with HBase files</h4>
 
 <p>This example assumes you are working in the Drill Sandbox. The <code>maprdb</code> storage plugin definition is limited, so you modify the <code>dfs</code> storage plugin slightly and use that plugin for this example.</p>
@@ -391,13 +307,15 @@ SELECT * FROM students;
 </code></pre></div></li>
 </ol>
 
-<h4 id="convert-the-binary-hbase-students-table-to-json-data.">Convert the binary HBase students table to JSON data.</h4>
+<h4 id="convert-the-binary-hbase-students-table-to-json-data">Convert the binary HBase students table to JSON data</h4>
+
+<p>First, you set the storage format to JSON. Next, you use the CREATE TABLE AS SELECT (CTAS) statement to convert from a selected file of a different format, HBase in this example, to the storage format. You then convert the JSON file to Parquet using a similar procedure. Set the storage format to Parquet, and use a CTAS statement to convert to Parquet from JSON. In each case, you <a href="/docs/data-type-conversion/#convert_to-and-convert_from-data-types">select UTF8</a> as the file format because the data you are converting from and then to consists of strings.</p>
 
 <ol>
 <li><p>Start Drill on the Drill Sandbox and set the default storage format from Parquet to JSON.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">ALTER SESSION SET `store.format`=&#39;json&#39;;
 </code></pre></div></li>
-<li><p>Use CONVERT_FROM queries to convert the VARBINARY data in the HBase students table to JSON, and store the JSON data in a file. </p>
+<li><p>Use CONVERT_FROM queries to convert the binary data in the HBase students table to JSON, and store the JSON data in a file. You select a data type to use from the supported. JSON supports strings. To convert binary to strings, use the UTF8 type.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">CREATE TABLE tmp.`to_json` AS SELECT 
     CONVERT_FROM(row_key, &#39;UTF8&#39;) AS `studentid`, 
     CONVERT_FROM(students.account.name, &#39;UTF8&#39;) AS name, 
@@ -420,7 +338,7 @@ ls
 <p>Output is:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">0_0_0.json
 </code></pre></div></li>
-<li><p>Take a look at the output om <code>to_json</code>:</p>
+<li><p>Take a look at the output of <code>to_json</code>:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">{
   &quot;studentid&quot; : &quot;student1&quot;,
   &quot;name&quot; : &quot;Alice&quot;,
@@ -506,7 +424,14 @@ FROM tmp.`json2parquet2`;
 
 <h2 id="other-data-type-conversions">Other Data Type Conversions</h2>
 
-<p>In addition to the CAST, CONVERT_TO, and CONVERT_FROM functions, Drill supports data type conversion functions to perform the following conversions:</p>
+<p>Drill supports the format for date and time literals shown in the following examples:</p>
+
+<ul>
+<li><p>2008-12-15</p></li>
+<li><p>22:55:55.123...</p></li>
+</ul>
+
+<p>If you have dates and times in other formats, use a data type conversion functions to perform the following conversions:</p>
 
 <ul>
 <li>A timestamp, integer, decimal, or double to a character string.</li>
@@ -514,37 +439,6 @@ FROM tmp.`json2parquet2`;
 <li>A character string to a number</li>
 </ul>
 
-<h2 id="time-zone-limitation">Time Zone Limitation</h2>
-
-<p>Currently Drill does not support conversion of a date, time, or timestamp from one time zone to another. The workaround is to configure Drill to use <a href="http://www.timeanddate.com/time/aboututc.html">UTC</a>-based time, convert your data to UTC timestamps, and perform date/time operation in UTC.  </p>
-
-<ol>
-<li><p>Take a look at the Drill time zone configuration by running the TIMEOFDAY function. This function returns the local date and time with time zone information.</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMEOFDAY() FROM sys.version;
-
-+------------+
-|   EXPR$0   |
-+------------+
-| 2015-04-02 15:01:31.114 America/Los_Angeles |
-+------------+
-1 row selected (1.199 seconds)
-</code></pre></div></li>
-<li><p>Configure the default time zone format in <drill installation directory>/conf/drill-env.sh by adding <code>-Duser.timezone=UTC</code> to DRILL_JAVA_OPTS. For example:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">export DRILL_JAVA_OPTS=&quot;-Xms1G -Xmx$DRILL_MAX_HEAP -XX:MaxDirectMemorySize=$DRILL_MAX_DIRECT_MEMORY -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=1G -ea -Duser.timezone=UTC&quot;
-</code></pre></div></li>
-<li><p>Restart sqlline.</p></li>
-<li><p>Confirm that Drill is now set to UTC:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMEOFDAY() FROM sys.version;
-
-+------------+
-|   EXPR$0   |
-+------------+
-| 2015-04-02 17:05:02.424 UTC |
-+------------+
-1 row selected (1.191 seconds)
-</code></pre></div></li>
-</ol>
-
 <p>The following table lists data type formatting functions that you can
 use in your Drill queries as described in this section:</p>
 
@@ -588,21 +482,9 @@ use in your Drill queries as described i
 </tr>
 </tbody></table>
 
-<p>You can use the ‘z’ option to identify the time zone in TO_TIMESTAMP to make sure the timestamp has the timezone in it. Also, use the ‘z’ option to identify the time zone in a timestamp using the TO_CHAR function. For example:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TO_TIMESTAMP(&#39;2015-03-30 20:49:59.0 UTC&#39;, &#39;YYYY-MM-dd HH:mm:ss.s z&#39;) AS Original, 
-       TO_CHAR(TO_TIMESTAMP(&#39;2015-03-30 20:49:59.0 UTC&#39;, &#39;YYYY-MM-dd HH:mm:ss.s z&#39;), &#39;z&#39;) AS TimeZone 
-       FROM sys.version;
-
-+------------+------------+
-|  Original  |  TimeZone  |
-+------------+------------+
-| 2015-03-30 20:49:00.0 | UTC        |
-+------------+------------+
-1 row selected (0.299 seconds)
-</code></pre></div>
 <h3 id="format-specifiers-for-numerical-conversions">Format Specifiers for Numerical Conversions</h3>
 
-<p>Use the following format specifiers for numerical conversions:
+<p>Use the following format specifiers for converting numbers:
 <table >
      <tr >
           <th align=left>Symbol
@@ -815,7 +697,7 @@ use in your Drill queries as described i
 
 <h2 id="to_char">TO_CHAR</h2>
 
-<p>TO_CHAR converts a date, time, timestamp, or numerical expression to a character string.</p>
+<p>TO_CHAR converts a number, date, time, or timestamp expression to a character string.</p>
 
 <h3 id="syntax">Syntax</h3>
 <div class="highlight"><pre><code class="language-text" data-lang="text">TO_CHAR (expression, &#39;format&#39;);
@@ -824,6 +706,10 @@ use in your Drill queries as described i
 
 <p><em>&#39;format&#39;</em> is a format specifier enclosed in single quotation marks that sets a pattern for the output formatting. </p>
 
+<h3 id="usage-notes">Usage Notes</h3>
+
+<p>You can use the ‘z’ option to identify the time zone in TO_TIMESTAMP to make sure the timestamp has the timezone in it, as shown in the TO_TIMESTAMP description.</p>
+
 <h3 id="examples">Examples</h3>
 
 <p>Convert a FLOAT to a character string.</p>
@@ -1069,6 +955,49 @@ FROM sys.version;
 +------------+------------+
 1 row selected (0.129 seconds)
 </code></pre></div>
+<h2 id="time-zone-limitation">Time Zone Limitation</h2>
+
+<p>Currently Drill does not support conversion of a date, time, or timestamp from one time zone to another. The workaround is to configure Drill to use <a href="http://www.timeanddate.com/time/aboututc.html">UTC</a>-based time, convert your data to UTC timestamps, and perform date/time operation in UTC.  </p>
+
+<ol>
+<li><p>Take a look at the Drill time zone configuration by running the TIMEOFDAY function. This function returns the local date and time with time zone information.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMEOFDAY() FROM sys.version;
+
++------------+
+|   EXPR$0   |
++------------+
+| 2015-04-02 15:01:31.114 America/Los_Angeles |
++------------+
+1 row selected (1.199 seconds)
+</code></pre></div></li>
+<li><p>Configure the default time zone format in <drill installation directory>/conf/drill-env.sh by adding <code>-Duser.timezone=UTC</code> to DRILL_JAVA_OPTS. For example:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">export DRILL_JAVA_OPTS=&quot;-Xms1G -Xmx$DRILL_MAX_HEAP -XX:MaxDirectMemorySize=$DRILL_MAX_DIRECT_MEMORY -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=1G -ea -Duser.timezone=UTC&quot;
+</code></pre></div></li>
+<li><p>Restart sqlline.</p></li>
+<li><p>Confirm that Drill is now set to UTC:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMEOFDAY() FROM sys.version;
+
++------------+
+|   EXPR$0   |
++------------+
+| 2015-04-02 17:05:02.424 UTC |
++------------+
+1 row selected (1.191 seconds)
+</code></pre></div></li>
+</ol>
+
+<p>You can use the ‘z’ option to identify the time zone in TO_TIMESTAMP to make sure the timestamp has the timezone in it. Also, use the ‘z’ option to identify the time zone in a timestamp using the TO_CHAR function. For example:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TO_TIMESTAMP(&#39;2015-03-30 20:49:59.0 UTC&#39;, &#39;YYYY-MM-dd HH:mm:ss.s z&#39;) AS Original, 
+       TO_CHAR(TO_TIMESTAMP(&#39;2015-03-30 20:49:59.0 UTC&#39;, &#39;YYYY-MM-dd HH:mm:ss.s z&#39;), &#39;z&#39;) AS TimeZone 
+       FROM sys.version;
+
++------------+------------+
+|  Original  |  TimeZone  |
++------------+------------+
+| 2015-03-30 20:49:00.0 | UTC        |
++------------+------------+
+1 row selected (0.299 seconds)
+</code></pre></div>
 <!-- DRILL-448 Support timestamp with time zone -->
 
 <!-- Apache Drill    

Modified: drill/site/trunk/content/drill/docs/data-types/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/data-types/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/data-types/index.html (original)
+++ drill/site/trunk/content/drill/docs/data-types/index.html Mon Apr 13 21:52:51 2015
@@ -67,11 +67,175 @@
 
 </div>
 
-<div class="int_text" align="left"><p>Depending on the data format, you might need to cast or convert data types when Drill reads/writes data.</p>
+<div class="int_text" align="left"><h2 id="supported-data-types">Supported Data Types</h2>
 
-<p>After Drill reads schema-less data into SQL tables, you need to cast data types explicitly to query the data. In some cases, Drill converts schema-less data to typed data implicitly. In this case, you do not need to cast. The file format of the data and the nature of your query determines the requirement for casting or converting. </p>
+<p>Drill supports the following SQL data types:</p>
 
-<p>Differences in casting depend on the data source. The following list describes how Drill treats data types from various data sources:</p>
+<ul>
+<li><p>BIGINT<br>
+8-byte signed integer in the range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.</p></li>
+<li><p>BINARY
+Variable-length byte string</p></li>
+<li><p>BOOLEAN<br>
+True or false  </p></li>
+<li><p>DATE<br>
+Years, months, and days in YYYY-MM-DD format since 4713 BC.</p></li>
+<li><p>DECIMAL(p,s), or DEC(p,s), NUMERIC(p,s)<br>
+38-digit precision number, precision is p, and scale is s. Example: DECIMAL(6,2) has 4 digits before the decimal point and 2 digits after the decimal point. </p></li>
+<li><p>FLOAT<br>
+4-byte floating point number</p></li>
+<li><p>DOUBLE, DOUBLE PRECISION**<br>
+8-byte floating point number, precision-scalable </p></li>
+<li><p>INTEGER or INT<br>
+4-byte signed integer in the range -2,147,483,648 to 2,147,483,647</p></li>
+<li><p>INTERVALDAY<br>
+A simple version of the interval type expressing a period of time in days, hours, minutes, and seconds only</p></li>
+<li><p>INTERVALYEAR<br>
+A simple version of interval representing a period of time in years and months only</p></li>
+<li><p>SMALLINT*<br>
+2-byte signed integer in the range -32,768 to 32,767</p></li>
+<li><p>TIME<br>
+24-hour based time before or after January 1, 2001 in hours, minutes, seconds format: HH:mm:ss </p></li>
+<li><p>TIMESTAMP<br>
+JDBC timestamp in year, month, date hour, minute, second, and optional milliseconds format: yyyy-MM-dd HH:mm:ss.SSS</p></li>
+<li><p>CHARACTER VARYING, CHARACTER, CHAR, or VARCHAR<br>
+UTF8-encoded variable-length string. For example, CHAR(30) casts data to a 30-character string maximum. The default limit is 1 character. The maximum character limit is 255.</p></li>
+</ul>
+
+<p>* Not currently supported.<br>
+** You specify a DECIMAL using a precision and scale. The precision (p) is the total number of digits required to represent the number. The scale (s) is the number of decimal digits to the right of the decimal point. Subtract s from p to determine the maximum number of digits to the left of the decimal point. Scale is a value from 0 through p. Scale is specified only if precision is specified. The default scale is 0.  </p>
+
+<h2 id="convert_to-and-convert_from-data-types">CONVERT_TO and CONVERT_FROM Data Types</h2>
+
+<p>The following table lists the data types for 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>
+<tr>
+<td>JSON</td>
+<td>bytes</td>
+<td>varchar</td>
+</tr>
+</tbody></table>
+
+<h2 id="using-drill-data-types">Using Drill Data Types</h2>
+
+<p>If you understand how to use Drill data types, you have captured the essence of Drill. In Drill, you use data types in the following ways:</p>
+
+<ul>
+<li>To cast or convert data to the required type for moving data from one data source to another</li>
+<li>To cast or convert data to the required type for Drill analysis</li>
+</ul>
+
+<p>In Drill, you do not use data types as you do in database software to define the type of a column during table creation. </p>
+
+<p>In some cases, Drill converts schema-less data to correctly-typed data implicitly. In this case, you do not need to cast the data. The file format of the data and the nature of your query determines the requirement for casting or converting. Differences in casting depend on the data source. The following list describes how Drill treats data types from various data sources:</p>
 
 <ul>
 <li>HBase<br>
@@ -88,15 +252,13 @@ Implicitly casts Parquet data to the SQL
 Implicitly casts all textual data to VARCHAR.</li>
 </ul>
 
-<h2 id="implicit-casting">Implicit Casting</h2>
-
-<p>Generally, Drill performs implicit casting based on the order of precedence shown in the implicit casting preference table. Drill usually implicitly casts a type from a lower precedence to a type having higher precedence. For instance, NULL can be promoted to any other type; SMALLINT can be promoted into INT. INT is not promoted to SMALLINT due to possible precision loss. Drill might deviate from these precedence rules for performance reasons.</p>
+<h2 id="precedence-of-data-types">Precedence of Data Types</h2>
 
-<p>Under certain circumstances, such as queries involving substr and concat functions, Drill reverses the order of precedence and allows a cast to VARCHAR from a type of higher precedence than VARCHAR, such as BIGINT. </p>
+<p>Drill reads from and writes to data sources having a wide variety of types, more types than those Drill <a href="/docs/data-type-conversion#supported-data-types">previously listed</a>. Drill uses data types at the RPC level that are not supported for query input, often implicitly casting data.</p>
 
-<p>The following table lists data types top to bottom, in descending order of precedence. Drill implicitly casts to more data types than are currently supported for explicit casting.</p>
+<p>The following list includes data types Drill uses in descending order of precedence. As shown in the table, you can cast a NULL value, which has the lowest precedence, to any other type; you can cast a SMALLINT value to INT. You cannot cast an INT value to SMALLINT due to possible precision loss. Drill might deviate from these precedence rules for performance reasons. Under certain circumstances, such as queries involving SUBSTR and CONCAT functions, Drill reverses the order of precedence and allows a cast to VARCHAR from a type of higher precedence than VARCHAR, such as BIGINT.</p>
 
-<h3 id="implicit-casting-precedence">Implicit Casting Precedence</h3>
+<h3 id="casting-precedence">Casting Precedence</h3>
 
 <table>
   <tr>
@@ -107,79 +269,80 @@ Implicitly casts all textual data to VAR
   </tr>
   <tr>
     <td>1</td>
-    <td>INTERVAL</td>
+    <td>INTERVALYEAR (highest)</td>
     <td>13</td>
-    <td>UINT4</td>
+    <td>INT</td>
   </tr>
   <tr>
     <td>2</td>
-    <td>INTERVALYEAR</td>
+    <td>INTERVLADAY</td>
     <td>14</td>
-    <td>INT</td>
+    <td>UINT2</td>
   </tr>
   <tr>
     <td>3</td>
-    <td>INTERVLADAY</td>
+    <td>TIMESTAMPTZ*</td>
     <td>15</td>
-    <td>UINT2</td>
+    <td>SMALLINT</td>
   </tr>
   <tr>
     <td>4</td>
-    <td>TIMESTAMPTZ</td>
+    <td>TIMETZ*</td>
     <td>16</td>
-    <td>SMALLINT</td>
+    <td>UINT1</td>
   </tr>
   <tr>
     <td>5</td>
-    <td>TIMETZ</td>
+    <td>TIMESTAMP</td>
     <td>17</td>
-    <td>UINT1</td>
+    <td>VAR16CHAR</td>
   </tr>
   <tr>
     <td>6</td>
-    <td>TIMESTAMP</td>
+    <td>DATE</td>
     <td>18</td>
-    <td>VAR16CHAR</td>
+    <td>FIXED16CHAR</td>
   </tr>
   <tr>
     <td>7</td>
-    <td>DATE</td>
+    <td>TIME</td>
     <td>19</td>
-    <td>FIXED16CHAR</td>
+    <td>VARCHAR</td>
   </tr>
   <tr>
     <td>8</td>
-    <td>TIME</td>
+    <td>DOUBLE</td>
     <td>20</td>
-    <td>VARCHAR</td>
+    <td>CHAR</td>
   </tr>
   <tr>
     <td>9</td>
-    <td>DOUBLE</td>
+    <td>DECIMAL</td>
     <td>21</td>
-    <td>CHAR</td>
+    <td>VARBINARY**</td>
   </tr>
   <tr>
     <td>10</td>
-    <td>DECIMAL</td>
+    <td>UINT8</td>
     <td>22</td>
-    <td>VARBINARY*</td>
+    <td>FIXEDBINARY**</td>
   </tr>
   <tr>
     <td>11</td>
-    <td>UINT8</td>
+    <td>BIGINT</td>
     <td>23</td>
-    <td>FIXEDBINARY*</td>
+    <td>NULL (lowest)</td>
   </tr>
   <tr>
     <td>12</td>
-    <td>BIGINT</td>
-    <td>24</td>
-    <td>NULL</td>
+    <td>UINT4</td>
+    <td></td>
+    <td></td>
   </tr>
 </table>
 
-<p>* The Drill Parquet reader supports these types.</p>
+<p>* Currently not supported.
+** The Drill Parquet reader supports these types.</p>
 
 <h2 id="explicit-casting">Explicit Casting</h2>
 
@@ -202,44 +365,6 @@ Converts a string to TIMESTAMP.</li>
 
 <p>If the SELECT statement includes a WHERE clause that compares a column of an unknown data type, cast both the value of the column and the comparison value in the WHERE clause.</p>
 
-<h2 id="supported-data-types-for-casting">Supported Data Types for Casting</h2>
-
-<p>You use the following data types in queries that involve casting/converting data types:</p>
-
-<ul>
-<li><p>BIGINT<br>
-8-byte signed integer. the range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.</p></li>
-<li><p>BOOLEAN<br>
-True or false  </p></li>
-<li><p>DATE<br>
-Years, months, and days in YYYY-MM-DD format</p></li>
-<li><p>DECIMAL(p,s), or DEC(p,s), NUMERIC(p,s) 
-38-digit precision number, precision is p, and scale is s. Example: DECIMAL(6,2) has 4 digits before the decimal point and 2 digits after the decimal point. </p></li>
-<li><p>FLOAT<br>
-4-byte single precision floating point number</p></li>
-<li><p>DOUBLE, DOUBLE PRECISION<br>
-8-byte double precision floating point number. </p></li>
-<li><p>INTEGER or INT<br>
-4-byte signed integer. The range is -2,147,483,648 to 2,147,483,647.</p></li>
-<li><p>INTERVAL<br>
-Integer fields representing a period of time in years, months, days hours, minutes, seconds and optional milliseconds using ISO 8601 format.</p></li>
-<li><p>INTERVALDAY<br>
-A simple version of the interval type expressing a period of time in days, hours, minutes, and seconds only.</p></li>
-<li><p>INTERVALYEAR<br>
-A simple version of interval representing a period of time in years and months only.</p></li>
-<li><p>SMALLINT<br>
-2-byte signed integer. The range is -32,768 to 32,767. Supported in Drill 0.9 and later. See DRILL-2135.</p></li>
-<li><p>TIME<br>
-Hours, minutes, seconds in the form HH:mm:ss, 24-hour based</p></li>
-<li><p>TIMESTAMP<br>
-JDBC timestamp in year, month, date hour, minute, second, and optional milliseconds: yyyy-MM-dd HH:mm:ss.SSS</p></li>
-<li><p>CHARACTER VARYING, CHARACTER, CHAR, or VARCHAR<br>
-Character string optionally declared with a length that indicates the maximum number of characters to use. For example, CHAR(30) casts data to a 30-character string maximum. The default limit is 1 character. The maximum character limit is 255.</p></li>
-</ul>
-
-<p>You specify a DECIMAL using a precision and scale. The precision (p) is the total number of digits required to represent the number.
-. The scale (s) is the number of decimal digits to the right of the decimal point. Subtract s from p to determine the maximum number of digits to the left of the decimal point. Scale is a value from 0 through p. Scale is specified only if precision is specified. The default scale is 0.</p>
-
 <p>For more information about and examples of casting, see <a href="">CAST</a>.</p>
 
 <h3 id="explicit-type-casting-maps">Explicit Type Casting Maps</h3>
@@ -274,7 +399,7 @@ Character string optionally declared wit
     <td>VARBINARY</td>
   </tr>
   <tr>
-    <td>SMALLINT</td>
+    <td>SMALLINT*</td>
     <td></td>
     <td>yes</td>
     <td>yes</td>
@@ -358,7 +483,7 @@ Character string optionally declared wit
     <td>yes</td>
   </tr>
   <tr>
-    <td>FIXEDBINARY*</td>
+    <td>FIXEDBINARY**</td>
     <td>yes</td>
     <td>yes</td>
     <td>yes</td>
@@ -370,7 +495,7 @@ Character string optionally declared wit
     <td>yes</td>
   </tr>
   <tr>
-    <td>VARCHAR**</td>
+    <td>VARCHAR***</td>
     <td>yes</td>
     <td>yes</td>
     <td>yes</td>
@@ -382,7 +507,7 @@ Character string optionally declared wit
     <td>yes</td>
   </tr>
   <tr>
-    <td>VARBINARY*</td>
+    <td>VARBINARY**</td>
     <td>yes</td>
     <td>yes</td>
     <td>yes</td>
@@ -395,9 +520,11 @@ Character string optionally declared wit
   </tr>
 </table>
 
-<p>* For use with CONVERT_TO/FROM to cast binary data coming to/from sources such as MapR-DB/HBase.</p>
+<p>* Not supported in this release.   </p>
+
+<p>** Used to cast binary data coming to/from sources such as MapR-DB/HBase.   </p>
 
-<p>** You cannot convert a character string having a decimal point to an INT or BIGINT.</p>
+<p>*** You cannot convert a character string having a decimal point to an INT or BIGINT.   </p>
 
 <h4 id="date-and-time-data-types">Date and Time Data Types</h4>
 
@@ -418,7 +545,6 @@ Character string optionally declared wit
     <td>TIME</td>
     <td>TIMESTAMP</td>
     <td>TIMESTAMPTZ</td>
-    <td>INTERVAL</td>
     <td>INTERVALYEAR</td>
     <td>INTERVALDAY</td>
   </tr>
@@ -433,7 +559,7 @@ Character string optionally declared wit
     <td>Yes</td>
   </tr>
   <tr>
-    <td>FIXEDBINARY</td>
+    <td>FIXEDBINARY*</td>
     <td>No</td>
     <td>No</td>
     <td>No</td>
@@ -453,7 +579,7 @@ Character string optionally declared wit
     <td>Yes</td>
   </tr>
   <tr>
-    <td>VARBINARY</td>
+    <td>VARBINARY*</td>
     <td>No</td>
     <td>No</td>
     <td>Yes</td>
@@ -493,7 +619,7 @@ Character string optionally declared wit
     <td>No</td>
   </tr>
   <tr>
-    <td>TIMESTAMPTZ</td>
+    <td>TIMESTAMPTZ**</td>
     <td>Yes</td>
     <td>Yes</td>
     <td>Yes</td>
@@ -503,16 +629,6 @@ Character string optionally declared wit
     <td>No</td>
   </tr>
   <tr>
-    <td>INTERVAL</td>
-    <td>Yes</td>
-    <td>No</td>
-    <td>Yes</td>
-    <td>Yes</td>
-    <td>No</td>
-    <td>Yes</td>
-    <td>Yes</td>
-  </tr>
-  <tr>
     <td>INTERVALYEAR</td>
     <td>Yes</td>
     <td>No</td>
@@ -533,6 +649,10 @@ Character string optionally declared wit
     <td>No</td>
   </tr>
 </table>
+
+<p>* Used to cast binary data coming to/from sources such as MapR-DB/HBase.   </p>
+
+<p>** Not supported in this release.   </p>
 </div>
 
 

Modified: drill/site/trunk/content/drill/docs/date-time-and-timestamp/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/date-time-and-timestamp/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/date-time-and-timestamp/index.html (original)
+++ drill/site/trunk/content/drill/docs/date-time-and-timestamp/index.html Mon Apr 13 21:52:51 2015
@@ -69,7 +69,9 @@
 
 <div class="int_text" align="left"><p>Using familiar date and time formats, listed in the <a href="/docs/data-types/supported-data-types">SQL data types table</a>, you can construct query date and time data. You need to cast textual data to date and time data types. The format of date, time, and timestamp text in a textual data source needs to match the SQL query format for successful casting. </p>
 
-<p>DATE, TIME, and TIMESTAMP store values in Coordinated Universal Time (UTC). Currently, Drill does not support casting a TIMESTAMP with time zone, but you can use the <a href="/docs/casting/converting-data-types#to_timestamp">TO_TIMESTAMP function</a> in a query to use time stamp data having a time zone.</p>
+<p>DATE, TIME, and TIMESTAMP store values in Coordinated Universal Time (UTC). Drill supports time functions in the range 1971 to 2037.</p>
+
+<p>Currently, Drill does not support casting a TIMESTAMP with time zone, but you can use the <a href="/docs/casting/converting-data-types#to_timestamp">TO_TIMESTAMP function</a> in a query to use time stamp data having a time zone.</p>
 
 <p>Next, use the following literals in a SELECT statement. </p>
 
@@ -103,9 +105,11 @@ SELECT timestamp &#39;2015-03-11 6:50:08
 </code></pre></div></li>
 </ul>
 
-<h2 id="interval">INTERVAL</h2>
+<h2 id="intervalyear-and-intervalday">INTERVALYEAR and INTERVALDAY</h2>
+
+<p>The INTERVALYEAR AND INTERVALDAY types represent a period of time. The INTERVALYEAR type specifies values from a year to a month. The INTERVALDAY type specifies values from a day to seconds.</p>
 
-<p>The INTERVAL type represents a period of time. Use ISO 8601 syntax to format a value of this type:</p>
+<p>Use ISO 8601 syntax to format an interval:</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">P [qty] Y [qty] M [qty] D T [qty] H [qty] M [qty] S
 
 P [qty] D T [qty] H [qty] M [qty] S
@@ -124,11 +128,25 @@ P [qty] Y [qty] M
 <li>S follows a number of seconds and optional milliseconds to the right of a decimal point</li>
 </ul>
 
-<p>INTERVALYEAR (Year, Month) and INTERVALDAY (Day, Hours, Minutes, Seconds, Milliseconds) are a simpler version of INTERVAL with a subset of the fields.  You do not need to specify all fields.</p>
+<p>You can restrict the set of stored interval fields by using one of these phrases in the query:</p>
 
-<p>The format of INTERVAL data in the data source differs from the query format. </p>
+<ul>
+<li>YEAR</li>
+<li>MONTH</li>
+<li>DAY</li>
+<li>HOUR</li>
+<li>MINUTE</li>
+<li>SECOND</li>
+<li>YEAR TO MONTH</li>
+<li>DAY TO HOUR</li>
+<li>DAY TO MINUTE</li>
+<li>DAY TO SECOND</li>
+<li>HOUR TO MINUTE</li>
+<li>HOUR TO SECOND</li>
+<li>MINUTE TO SECOND</li>
+</ul>
 
-<p>You can run the query described earlier to check the formatting of the fields. The input to the following SELECT statements show how to format INTERVAL data in the query. The output shows how to format the data in the data source.</p>
+<p>The following examples show the input and output format of INTERVALYEAR (Year, Month) and INTERVALDAY (Day, Hours, Minutes, Seconds, Milliseconds). The following SELECT statements show how to format the query input. The output shows how to format the data in the data source.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">SELECT INTERVAL &#39;1 10:20:30.123&#39; day to second FROM sys.version;
 +------------+
 |   EXPR$0   |

Modified: drill/site/trunk/content/drill/docs/date-time-functions-and-arithmetic/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/date-time-functions-and-arithmetic/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/date-time-functions-and-arithmetic/index.html (original)
+++ drill/site/trunk/content/drill/docs/date-time-functions-and-arithmetic/index.html Mon Apr 13 21:52:51 2015
@@ -67,7 +67,9 @@
 
 </div>
 
-<div class="int_text" align="left"><p>In addition to the TO_DATE, TO_TIME, and TO_TIMESTAMP functions, Drill supports a number of other date/time functions and arithmetic operators for use with dates, times, and intervals. The following table lists date/time functions described in this section:</p>
+<div class="int_text" align="left"><p>In addition to the TO_DATE, TO_TIME, and TO_TIMESTAMP functions, Drill supports a number of other date/time functions and arithmetic operators for use with dates, times, and intervals. Drill supports time functions based on the Gregorian calendar and in the range 1971 to 2037.</p>
+
+<p>This section defines the following date/time functions:</p>
 
 <table><thead>
 <tr>
@@ -80,76 +82,52 @@
 <td>INTERVAL</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#current_date">CURRENT_DATE</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#extract">EXTRACT(field from time_expression)</a></td>
+<td>double precision</td>
+</tr>
+<tr>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">CURRENT_DATE</a></td>
 <td>DATE</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#current_time">CURRENT_TIME</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">CURRENT_TIME</a></td>
 <td>TIME</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#current_timestamp">CURRENT_TIMESTAMP</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">CURRENT_TIMESTAMP</a></td>
 <td>TIMESTAMP</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#date_add">DATE_ADD(DATE,INTERVAL expr type)</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#date_add">DATE_ADD</a></td>
 <td>date/datetime</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#date_part">DATE_PART(text, time_expression)</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#date_part">DATE_PART</a></td>
 <td>double precision</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#date_sub">DATE_SUB(DATE,INTERVAL expr type)</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#date_sub">DATE_SUB</a></td>
 <td>date/datetime</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#extract">EXTRACT(field from time_expression)</a></td>
-<td>double precision</td>
-</tr>
-<tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#localtime">LOCALTIME</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">LOCALTIME</a></td>
 <td>TIME</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#localtimestamp">LOCALTIMESTAMP</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">LOCALTIMESTAMP</a></td>
 <td>TIMESTAMP</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#now">NOW()</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">NOW</a></td>
 <td>TIMESTAMP</td>
 </tr>
 <tr>
-<td><a href="/docs/date-time-functions-and-arithmetic#timeofday">TIMEOFDAY()</a></td>
+<td><a href="/docs/date-time-functions-and-arithmetic#current_*x*-local*x*-now-and-timeofday">TIMEOFDAY</a></td>
 <td>text</td>
 </tr>
 </tbody></table>
 
-<h2 id="date/time-functions-and-utilities">Date/Time Functions and Utilities</h2>
-
-<p>The following functions perform date/time-related operations:</p>
-
-<ul>
-<li>AGE</li>
-<li>EXTRACT</li>
-<li>DATE_ADD</li>
-<li>DATE_PART</li>
-<li>DATE_SUB</li>
-</ul>
-
-<p>Drill supports the following utilities:</p>
-
-<ul>
-<li>CURRENT_DATE</li>
-<li>CURRENT_TIME</li>
-<li>CURRENT_TIMESTAMP</li>
-<li>LOCALTIME</li>
-<li>LOCALTIMESTAMP</li>
-<li>NOW</li>
-<li>TIMEOFDAY</li>
-</ul>
-
-<h3 id="age">AGE</h3>
+<h2 id="age">AGE</h2>
 
 <p>Returns the interval between two timestamps or subtracts a timestamp from midnight of the current date.</p>
 
@@ -184,85 +162,89 @@
 </code></pre></div>
 <p>For information about how to read the interval data, see the <a href="/docs/date-time-and-timestamp#interval">Interval section</a>.</p>
 
-<h3 id="extract">EXTRACT</h3>
+<h3 id="date_add">DATE_ADD</h3>
 
-<p>Returns a component of a timestamp, time, date, or interval.</p>
+<p>Returns the sum of a date/time and a number of days/hours, or of a date/time and date/time interval.</p>
 
 <h4 id="syntax">Syntax</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">EXTRACT (expression);
-</code></pre></div>
-<p><em>expression</em> is:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">component FROM (timestamp | time | date | interval)
+<div class="highlight"><pre><code class="language-text" data-lang="text">DATE_ADD(date literal_date, integer);
+
+DATE_ADD(keyword literal, interval expr); 
 </code></pre></div>
-<p><em>component</em> is a year, month, day, hour, minute, or second value.</p>
+<p><em>date</em> is the keyword date.<br>
+<em>literal_date</em> is a date in yyyy-mm-dd format enclosed in single quotation marks.<br>
+<em>integer</em> is a number of days to add to the date/time.  </p>
+
+<p><em>keyword</em> is the word date, time, or timestamp.<br>
+<em>literal</em> is a date, time, or timestamp literal.<br>
+<em>interval</em> is a keyword<br>
+<em>expr</em> is an interval expression.  </p>
 
 <h4 id="examples">Examples</h4>
 
-<p>On the third day of the month, run the following function:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(day FROM NOW()), EXTRACT(day FROM CURRENT_DATE) FROM sys.version;
-
-+------------+------------+
-|   EXPR$0   |   EXPR$1   |
-+------------+------------+
-| 3          | 3          |
-+------------+------------+
-1 row selected (0.208 seconds)
+<p>Add two days to today&#39;s date May 15, 2015.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(date &#39;2015-05-15&#39;, 2) from sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2015-05-17 |
++------------+
+1 row selected (0.07 seconds)
 </code></pre></div>
-<p>At 8:00 am, extract the hour from the value of CURRENT_DATE.</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(hour FROM CURRENT_DATE) FROM sys.version;
-
+<p>Add two months to April 15, 2015.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(date &#39;2015-04-15&#39;, interval &#39;2&#39; month) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
-| 8          |
+| 2015-06-15 00:00:00.0 |
 +------------+
+1 row selected (0.073 seconds)
 </code></pre></div>
-<p>What is the hour component of this time: 17:12:28.5?</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(hour FROM TIME &#39;17:12:28.5&#39;) from sys.version;
-
+<p>Add 10 hours to the timestamp 2015-04-15 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(timestamp &#39;2015-04-15 22:55:55&#39;, interval &#39;10&#39; hour) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
-| 17         |
+| 2015-04-16 08:55:55.0 |
 +------------+
-1 row selected (0.056 seconds)
+1 row selected (0.068 seconds)
 </code></pre></div>
-<p>What is the second component of this timestamp: 2001-02-16 20:38:40</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(SECOND FROM TIMESTAMP &#39;2001-02-16 20:38:40&#39;) from sys.version;
-
+<p>Add 10 hours to the time 22 hours, 55 minutes, 55 seconds.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(time &#39;22:55:55&#39;, interval &#39;10&#39; hour) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
-| 40.0       |
+| 08:55:55   |
 +------------+
-1 row selected (0.062 seconds)
+1 row selected (0.085 seconds)
 </code></pre></div>
-<h3 id="date_add">DATE_ADD</h3>
-
-<p>Returns the sum of a date and an interval.</p>
-
-<h4 id="syntax">Syntax</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">DATE_ADD(date, interval);
+<p>Add 1 year and 1 month to the timestamp 2015-04-15 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(timestamp &#39;2015-04-15 22:55:55&#39;, interval &#39;1-2&#39; year to month) FROM sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2016-06-15 22:55:55.0 |
++------------+
+1 row selected (0.065 seconds)
 </code></pre></div>
-<h4 id="example">Example</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(DATE_ADD(datetype(2008, 2, 27), intervaltype(0, 1, 0, 0, 0, 0, 0)) as VARCHAR(100)) FROM sys.version;
+<p>Add 1 day 2 and 1/2 hours and 45.100 seconds to the time 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(time &#39;22:55:55&#39;, interval &#39;1 2:30:45.100&#39; day to second) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
-| 2008-03-27 00:00:00.000 |
+| 01:26:40.100 |
 +------------+
-1 row selected (0.247 seconds)
+1 row selected (0.07 seconds)
 </code></pre></div>
 <h3 id="date_part">DATE_PART</h3>
 
 <p>Returns a field of a date, time, timestamp, or interval.</p>
 
 <h4 id="syntax">Syntax</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">date_part(component, expression);
+<div class="highlight"><pre><code class="language-text" data-lang="text">date_part(keyword, expression);
 </code></pre></div>
-<p><em>component</em> is year, month, day, hour, minute, second, enclosed in single quotation marks.</p>
-
-<p><em>expression</em> is date, time, timestamp, or interval enclosed in single quotation marks.</p>
+<p><em>keyword</em> is year, month, day, hour, minute, or second enclosed in single quotation marks.<br>
+<em>expression</em> is date, time, timestamp, or interval literal enclosed in single quotation marks.</p>
 
 <h4 id="usage-notes">Usage Notes</h4>
 
@@ -305,23 +287,81 @@ SELECT DATE_PART(&#39;hour&#39;, &#39;23
 </code></pre></div>
 <h3 id="date_sub">DATE_SUB</h3>
 
-<p>Returns the sum of a date and an interval.</p>
+<p>Returns the difference between a date/time and a number of days/hours, or between a date/time and date/time interval.</p>
 
 <h4 id="syntax">Syntax</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">DATE_SUB(date, interval);
+<div class="highlight"><pre><code class="language-text" data-lang="text">DATE_SUB(date literal_date, integer);
+
+DATE_SUB(keyword literal, interval expr); 
+</code></pre></div>
+<p><em>date</em> is the keyword date.<br>
+<em>literal_date</em> is a date in yyyy-mm-dd format enclosed in single quotation marks.<br>
+<em>integer</em> is a number of days to subtract from the date/time.  </p>
+
+<p><em>keyword</em> is the word date, time, or timestamp.<br>
+<em>literal</em> is a date, time, or timestamp literal.<br>
+<em>interval</em> is a keyword.<br>
+<em>expr</em> is an interval expression.</p>
+
+<h4 id="examples">Examples</h4>
+
+<p>Subtract two days to today&#39;s date May 15, 2015.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_SUB(date &#39;2015-05-15&#39;, 2) from sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2015-05-13 |
++------------+
+1 row selected (0.088 seconds)
+</code></pre></div>
+<p>Subtact two months from April 15, 2015.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_SUB(date &#39;2015-04-15&#39;, interval &#39;2&#39; month) FROM sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2015-02-15 |
++------------+
+1 row selected (0.088 seconds)
+</code></pre></div>
+<p>Subtract 10 hours from the timestamp 2015-04-15 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_SUB(timestamp &#39;2015-04-15 22:55:55&#39;, interval &#39;10&#39; hour) FROM sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2015-04-15 12:55:55.0 |
++------------+
+1 row selected (0.068 seconds)
+</code></pre></div>
+<p>Subtract 10 hours from the time 22 hours, 55 minutes, 55 seconds.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_SUB(time &#39;22:55:55&#39;, interval &#39;10&#39; hour) FROM sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 12:55:55   |
++------------+
+1 row selected (0.079 seconds)
+</code></pre></div>
+<p>Subtract 1 year and 1 month from the timestamp 2015-04-15 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_SUB(timestamp &#39;2015-04-15 22:55:55&#39;, interval &#39;1-2&#39; year to month) FROM sys.version;
++------------+
+|   EXPR$0   |
++------------+
+| 2014-02-15 22:55:55.0 |
++------------+
+1 row selected (0.073 seconds)
 </code></pre></div>
-<h4 id="example">Example</h4>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CAST(DATE_SUB(datetype(2008, 2, 27), intervaltype(0, 1, 0, 0, 0, 0, 0)) as VARCHAR(100)) FROM sys.version;
+<p>Subtract 1 day, 2 and 1/2 hours, and 45.100 seconds from the time 22:55:55.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT DATE_ADD(time &#39;22:55:55&#39;, interval &#39;1 2:30:45.100&#39; day to second) FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
-| 2008-01-27 |
+| 01:26:40.100 |
 +------------+
-1 row selected (0.199 seconds)
+1 row selected (0.073 seconds)
 </code></pre></div>
-<h3 id="date/time-utilities">Date/Time Utilities</h3>
+<h3 id="current_x,-local*x*,-now,-and-timeofday">CURRENT_<em>x</em>, LOCAL*x*, NOW, and TIMEOFDAY</h3>
 
-<p>The utilities are:</p>
+<p>The following examples show how to use these functions:</p>
 
 <ul>
 <li>CURRENT_DATE</li>
@@ -330,60 +370,59 @@ SELECT DATE_PART(&#39;hour&#39;, &#39;23
 <li>LOCALTIME</li>
 <li>LOCALTIMESTAMP</li>
 <li>NOW</li>
-<li>TIMEOFDAY</li>
-</ul>
+<li><p>TIMEOFDAY</p>
 
-<p>The following examples show how to use the utilities:</p>
-<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT CURRENT_DATE FROM sys.version;
+<p>SELECT CURRENT_DATE FROM sys.version;
 +--------------+
 | current_date |
 +--------------+
 | 2015-04-02   |
 +--------------+
-1 row selected (0.077 seconds)
+1 row selected (0.077 seconds)</p>
 
-SELECT CURRENT_TIME FROM sys.version;
+<p>SELECT CURRENT_TIME FROM sys.version;
 +--------------+
 | current_time |
 +--------------+
 | 14:32:04.751 |
 +--------------+
-1 row selected (0.073 seconds)
+1 row selected (0.073 seconds)</p>
 
-SELECT CURRENT_TIMESTAMP FROM sys.version;
+<p>SELECT CURRENT_TIMESTAMP FROM sys.version;
 +-------------------+
 | current_timestamp |
 +-------------------+
 | 2015-04-02 14:32:34.047 |
 +-------------------+
-1 row selected (0.061 seconds)
+1 row selected (0.061 seconds)</p>
 
-SELECT LOCALTIME FROM sys.version;
+<p>SELECT LOCALTIME FROM sys.version;</p>
 
-+------------+
+<p>+------------+
 | localtime  |
 +------------+
 | 14:33:04.95 |
 +------------+
-1 row selected (0.051 seconds)
+1 row selected (0.051 seconds)</p>
 
-SELECT LOCALTIMESTAMP FROM sys.version;
+<p>SELECT LOCALTIMESTAMP FROM sys.version;</p>
 
-+----------------+
+<p>+----------------+
 | LOCALTIMESTAMP |
 +----------------+
 | 2015-04-02 23:13:13.204 |
 +----------------+
-1 row selected (0.105 seconds)
+1 row selected (0.105 seconds)</p>
 
-SELECT NOW() FROM sys.version;
+<p>SELECT NOW() FROM sys.version;
 +------------+
 |   EXPR$0   |
 +------------+
 | 2015-04-02 23:14:30.076 |
 +------------+
-1 row selected (0.05 seconds)
-</code></pre></div>
+1 row selected (0.05 seconds)</p></li>
+</ul>
+
 <p>If you set up Drill for <a href="/docs/casting-converting-data-types/time-zone-limitation">UTC time</a>, TIMEOFDAY returns the result for the UTC time zone.</p>
 <div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMEOFDAY() FROM sys.version;
 +------------+
@@ -402,7 +441,64 @@ SELECT NOW() FROM sys.version;
 +------------+
 1 row selected (1.199 seconds)
 </code></pre></div>
-<h3 id="date,-time,-and-interval-arithmetic-functions">Date, Time, and Interval Arithmetic Functions</h3>
+<h3 id="extract">EXTRACT</h3>
+
+<p>Returns a component of a timestamp, time, date, or interval.</p>
+
+<h4 id="syntax">Syntax</h4>
+<div class="highlight"><pre><code class="language-text" data-lang="text">EXTRACT (extract_expression);
+</code></pre></div>
+<p><em>extract_expression</em> is:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">component FROM (timestamp | time | date | interval)
+</code></pre></div>
+<p><em>component</em> is supported time unit.</p>
+
+<h4 id="usage-notes">Usage Notes</h4>
+
+<p>The extract function supports the following time units: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND.</p>
+
+<h4 id="examples">Examples</h4>
+
+<p>On the third day of the month, run the following function:</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(day FROM NOW()), EXTRACT(day FROM CURRENT_DATE) FROM sys.version;
+
++------------+------------+
+|   EXPR$0   |   EXPR$1   |
++------------+------------+
+| 3          | 3          |
++------------+------------+
+1 row selected (0.208 seconds)
+</code></pre></div>
+<p>At 8:00 am, extract the hour from the value of CURRENT_DATE.</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(hour FROM CURRENT_DATE) FROM sys.version;
+
++------------+
+|   EXPR$0   |
++------------+
+| 8          |
++------------+
+</code></pre></div>
+<p>What is the hour component of this time: 17:12:28.5?</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(hour FROM TIME &#39;17:12:28.5&#39;) from sys.version;
+
++------------+
+|   EXPR$0   |
++------------+
+| 17         |
++------------+
+1 row selected (0.056 seconds)
+</code></pre></div>
+<p>What is the seconds component of this timestamp: 2001-02-16 20:38:40</p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT EXTRACT(SECOND FROM TIMESTAMP &#39;2001-02-16 20:38:40&#39;) from sys.version;
+
++------------+
+|   EXPR$0   |
++------------+
+| 40.0       |
++------------+
+1 row selected (0.062 seconds)
+</code></pre></div>
+<h2 id="date,-time,-and-interval-arithmetic-functions">Date, Time, and Interval Arithmetic Functions</h2>
 
 <!-- date +/- integer
 date + interval  -->

Modified: drill/site/trunk/content/drill/docs/functions-for-handling-nulls/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/functions-for-handling-nulls/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/functions-for-handling-nulls/index.html (original)
+++ drill/site/trunk/content/drill/docs/functions-for-handling-nulls/index.html Mon Apr 13 21:52:51 2015
@@ -67,7 +67,7 @@
 
 </div>
 
-<div class="int_text" align="left"><p>Drill supports the following SQL functions:</p>
+<div class="int_text" align="left"><p>Drill supports the following functions for handling nulls:</p>
 
 <ul>
 <li>COALESCE</li>

Modified: drill/site/trunk/content/drill/docs/handling-different-data-types/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/handling-different-data-types/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/handling-different-data-types/index.html (original)
+++ drill/site/trunk/content/drill/docs/handling-different-data-types/index.html Mon Apr 13 21:52:51 2015
@@ -73,7 +73,7 @@
 
 <h2 id="handling-textual-data">Handling Textual Data</h2>
 
-<p>In a textual file, such as CSV, Drill interprets every field as a VARCHAR, as previously mentioned. In addition to using the CAST function, you can also use to_char, to_date, to_number, and to_timestamp. If the SELECT statement includes a WHERE clause that compares a column of an unknown data type, cast both the value of the column and the comparison value in the WHERE clause.</p>
+<p>In a textual file, such as CSV, Drill interprets every field as a VARCHAR, as previously mentioned. In addition to using the CAST function, you can also use TO_CHAR, TO_DATE, TO_NUMBER, and TO_TIMESTAMP. If the SELECT statement includes a WHERE clause that compares a column of an unknown data type, cast both the value of the column and the comparison value in the WHERE clause.</p>
 
 <h2 id="handling-json-and-parquet-data">Handling JSON and Parquet Data</h2>
 

Modified: drill/site/trunk/content/drill/docs/img/loginSandBox.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/loginSandBox.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vbApplSettings.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vbApplSettings.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vbGenSettings.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vbGenSettings.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vbImport.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vbImport.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vbNetwork.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vbNetwork.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vbloginSandBox.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vbloginSandBox.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vmLibrary.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vmLibrary.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/img/vmShare.png
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/img/vmShare.png?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
Binary files - no diff available.

Modified: drill/site/trunk/content/drill/docs/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/index.html (original)
+++ drill/site/trunk/content/drill/docs/index.html Mon Apr 13 21:52:51 2015
@@ -7639,7 +7639,7 @@
               
             
               
-                <li><a href="/docs/overview/">Overview</a></li>
+                <li><a href="/docs/configuration-options-overview/">Configuration Options Overview</a></li>
               
             
               

Modified: drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-virtualbox/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-virtualbox/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-virtualbox/index.html (original)
+++ drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-virtualbox/index.html Mon Apr 13 21:52:51 2015
@@ -87,45 +87,49 @@ VirtualBox:</p>
 <li><p>When the import completes, select <strong>File &gt; Preferences</strong>. The VirtualBox - Settings dialog appears.</p>
 
 <p><img src="/docs/img/vbNetwork.png" alt="drill query flow"></p></li>
-<li><p>Select <strong>Network</strong>.  </p>
+<li><p>Select <strong>Network</strong>.<br>
+The correct setting depends on your network connectivity when you run the
+Sandbox:  </p>
 
-<p>The correct setting depends on your network connectivity when you run the
-Sandbox. In general, if you are going to use a wired Ethernet connection,
-select <strong>NAT Networks **and **vboxnet0</strong>. If you are going to use a wireless
+<ul>
+<li>If you are going to use a wired Ethernet connection, generally its best to
+select <strong>NAT Network</strong> and <strong>vboxnet0</strong>.<br></li>
+<li>If you use ODBC or JDBC on a remote host, select <strong>Bridged Adapter</strong>.<br></li>
+<li>If you are going to use a wireless
 network, select <strong>Host-only Networks</strong> and the <strong>VirtualBox Host-Only Ethernet
-Adapter</strong>. If no adapters appear, click the green** +** button to add the
-VirtualBox adapter.</p>
-
-<p><img src="/docs/img/vbMaprSetting.png" alt="drill query flow"></p></li>
-<li><p>Click **OK **to continue.</p></li>
-<li><p>Click Settings.</p>
-
-<p><img src="/docs/img/settings.png" alt="settings icon"><br>
-The MapR-Sandbox-For-Apache-Drill-0.6.0-r2-4.0.1 - Settings dialog appears.</p>
-
-<p><img src="/docs/img/vbGenSettings.png" alt="drill query flow">    </p></li>
-<li><p>Click <strong>OK</strong> to continue.</p></li>
-<li><p>Click <strong>Start</strong>. It takes a few minutes for the MapR services to start.   </p>
-
-<p>After the MapR services start and installation completes, the following screen appears:</p>
+Adapter</strong>.<br></li>
+</ul>
 
-<p><img src="/docs/img/vbloginSandBox.png" alt="drill query flow"></p></li>
-<li><p>The client must be able to resolve the actual hostname of the Drill node(s) with the IP(s). Verify that a DNS entry was created on the client machine for the Drill node(s).  </p>
+<p>If no adapters appear, click the green <strong>+</strong> button to add the
+VirtualBox adapter.</p></li>
+</ol>
 
-<p>If a DNS entry does not exist, create the entry for the Drill node(s).</p>
+<p><img src="/docs/img/vbMaprSetting.png" alt="drill query flow">
+8. Click <strong>OK</strong> to continue.<br>
+9. Click Settings. 
+<img src="/docs/img/settings.png" alt="settings icon"><br>
+   The MapR Settings dialog appears.<br>
+<img src="/docs/img/vbGenSettings.png" alt="drill query flow"><br>
+10.Click <strong>OK</strong> to continue.<br>
+11.Click <strong>Start</strong>. It takes a few minutes for the MapR services to start.<br>
+   After the MapR services start and installation completes, the following screen appears:<br>
+<img src="/docs/img/vbloginSandBox.png" alt="drill query flow">
+   Note the URL provided in the screen.<br>
+12.The client must be able to resolve the actual hostname of the Drill node(s) with the IP(s). Verify that a DNS entry was created on the client machine for the Drill node(s). If a DNS entry does not exist, create the entry for the Drill node(s):  </p>
 
 <ul>
-<li>For Windows, create the entry in the %WINDIR%\system32\drivers\etc\hosts file.</li>
+<li>For Windows, create the entry in the %WINDIR%\system32\drivers\etc\hosts file.<br></li>
 <li>For Linux and Mac, create the entry in /etc/hosts.<br>
-<drill-machine-IP> <drill-machine-hostname><br></li>
+<drill-machine-IP> <drill-machine-hostname>
+    Example: <code>127.0.1.1 maprdemo</code><br></li>
 </ul>
 
-<p>Example: <code>127.0.1.1 maprdemo</code></p></li>
-<li><p>You can navigate to the URL provided or to <a href="http://localhost:8047">localhost:8047</a> to experience the Drill Web UI, or you can log into the sandbox through the command line.  </p>
+<p>13.You can navigate to the URL provided or to <a href="http://localhost:8047">localhost:8047</a> to experience the Drill Web UI, or you can log into the sandbox through the command line.  </p>
 
-<p>a. To navigate to the MapR Sandbox with Apache Drill, enter the provided URL in your browser&#39;s address bar.<br>
-b. To log into the virtual machine and access the command line, enter Alt+F2 on Windows or Option+F5 on Mac. When prompted, enter <code>mapr</code> as the login name and password.</p></li>
-</ol>
+<ul>
+<li>To navigate to the MapR Sandbox with Apache Drill, enter the provided URL in your browser&#39;s address bar.<br></li>
+<li>To log into the virtual machine and access the command line, enter Alt+F2 on Windows or Option+F5 on Mac. When prompted, enter <code>mapr</code> as the login name and password.</li>
+</ul>
 
 <h1 id="what&#39;s-next">What&#39;s Next</h1>
 

Modified: drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-vmware-player-vmware-fusion/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-vmware-player-vmware-fusion/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-vmware-player-vmware-fusion/index.html (original)
+++ drill/site/trunk/content/drill/docs/installing-the-mapr-sandbox-with-apache-drill-on-vmware-player-vmware-fusion/index.html Mon Apr 13 21:52:51 2015
@@ -73,22 +73,22 @@ VMware Player or VMware Fusion:</p>
 <ol>
 <li>Download the MapR Sandbox with Drill file to a directory on your machine:<br>
 <a href="https://www.mapr.com/products/mapr-sandbox-hadoop/download-sandbox-drill">https://www.mapr.com/products/mapr-sandbox-hadoop/download-sandbox-drill</a></li>
-<li><p>Open the virtual machine player, and select the *<em>Open a Virtual Machine *</em>option.  </p>
+<li><p>Open the virtual machine player, and select the <strong>Open a Virtual Machine</strong> option.  </p>
 
 <p><strong>Tip for VMware Fusion</strong>  </p>
 
-<p>If you are running VMware Fusion, select** Import**.  </p>
+<p>If you are running VMware Fusion, select <strong>Import</strong>.  </p>
 
 <p><img src="/docs/img/vmWelcome.png" alt="drill query flow"></p></li>
-<li><p>Navigate to the directory where you downloaded the MapR Sandbox with Apache Drill file, and select <code>MapR-Sandbox-For-Apache-Drill-4.0.1_VM.ova</code>.</p>
+<li><p>Navigate to the directory where you downloaded the MapR Sandbox with Apache Drill file, and select <code>MapR-Sandbox-For-Apache-Drill-0.8.0-4.1.0-vmware</code>.  </p>
 
-<p><img src="/docs/img/vmShare.png" alt="drill query flow"></p>
+<p>The Import Virtual Machine dialog appears.</p>
 
-<p>The Import Virtual Machine dialog appears.</p></li>
+<p><img src="/docs/img/vmShare.png" alt="drill query flow"></p></li>
 <li><p>Click <strong>Import</strong>. The virtual machine player imports the sandbox.</p>
 
 <p><img src="/docs/img/vmLibrary.png" alt="drill query flow"></p></li>
-<li><p>Select <code>MapR-Sandbox-For-Apache-Drill-4.0.1_VM</code>, and click <strong>Play virtual machine</strong>. It takes a few minutes for the MapR services to start.  </p>
+<li><p>Select <code>MapR-Sandbox-For-Apache-Drill-0.8.0-4.1.0-vmware</code>, and click <strong>Play virtual machine</strong>. It takes a few minutes for the MapR services to start.  </p>
 
 <p>After the MapR services start and installation completes, the following screen
 appears:</p>
@@ -97,18 +97,19 @@ appears:</p>
 
 <p>Note the URL provided in the screen, which corresponds to the Web UI in Apache
 Drill.</p></li>
-<li><p>Verify that a DNS entry was created on the host machine for the virtual machine. If not, create the entry.</p>
+<li><p>Verify that a DNS entry was created on the host machine for the virtual machine. If not, create the entry.  </p>
 
 <ul>
 <li>For Linux and Mac, create the entry in <code>/etc/hosts</code>.<br></li>
-<li>For Windows, create the entry in the <code>%WINDIR%\system32\drivers\etc\hosts</code> file.<br></li>
-</ul>
-
-<p>For example: <code>127.0.1.1 &lt;vm_hostname&gt;</code></p></li>
+<li>For Windows, create the entry in the <code>%WINDIR%\system32\drivers\etc\hosts</code> file.<br>
+For example: <code>127.0.1.1 &lt;vm_hostname&gt;</code><br></li>
+</ul></li>
 <li><p>You can navigate to the URL provided to experience Drill Web UI or you can login to the sandbox through the command line.  </p>
 
-<p>a. To navigate to the MapR Sandbox with Apache Drill, enter the provided URL in your browser&#39;s address bar.<br>
-b. To login to the virtual machine and access the command line, press Alt+F2 on Windows or Option+F5 on Mac. When prompted, enter <code>mapr</code> as the login name and password.</p></li>
+<ul>
+<li>To navigate to the MapR Sandbox with Apache Drill, enter the provided URL in your browser&#39;s address bar.<br></li>
+<li>To login to the virtual machine and access the command line, press Alt+F2 on Windows or Option+F5 on Mac. When prompted, enter <code>mapr</code> as the login name and password.</li>
+</ul></li>
 </ol>
 
 <h2 id="what&#39;s-next">What&#39;s Next</h2>

Modified: drill/site/trunk/content/drill/docs/lexical-structure/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/lexical-structure/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/lexical-structure/index.html (original)
+++ drill/site/trunk/content/drill/docs/lexical-structure/index.html Mon Apr 13 21:52:51 2015
@@ -129,6 +129,18 @@
 
 <p>Boolean values are true or false and are case-insensitive. Do not enclose the values in quotation marks.</p>
 
+<h3 id="date-and-time">Date and Time</h3>
+
+<p>Format dates using dashes (-) to separate year, month, and day. Format time using colons (:) to separate hours, minutes and seconds. Format timestamps using a date and a time. These literals are shown in the following examples:</p>
+
+<ul>
+<li><p>Date: 2008-12-15</p></li>
+<li><p>Time: 22:55:55.123...</p></li>
+<li><p>Timestamp: 2008-12-15 22:55:55.12345</p></li>
+</ul>
+
+<p>If you have dates and times in other formats, use a <a href="/data-type-conversion/#other-data-type-conversions">data type conversion function</a> in your queries.</p>
+
 <h3 id="identifier">Identifier</h3>
 
 <p>An identifier is a letter followed by any sequence of letters, digits, or the underscore. For example, names of tables, columns, and aliases are identifiers. Maximum length is 1024 characters. Enclose the following identifiers in back ticks:</p>

Modified: drill/site/trunk/content/drill/docs/persistent-configuration-storage/index.html
URL: http://svn.apache.org/viewvc/drill/site/trunk/content/drill/docs/persistent-configuration-storage/index.html?rev=1673293&r1=1673292&r2=1673293&view=diff
==============================================================================
--- drill/site/trunk/content/drill/docs/persistent-configuration-storage/index.html (original)
+++ drill/site/trunk/content/drill/docs/persistent-configuration-storage/index.html Mon Apr 13 21:52:51 2015
@@ -128,10 +128,6 @@ override.conf.</code></p>
 </code></pre></div>
 <h2 id="mapr-db-for-persistent-configuration-storage">MapR-DB for Persistent Configuration Storage</h2>
 
-<p>The MapR-DB plugin will be released soon. You can <a href="/docs/compiling-drill-from-source">compile Drill from
-source</a> to try out this
-new feature.</p>
-
 <p>If you have MapR-DB in your cluster, you can use MapR-DB for persistent
 configuration storage. Using MapR-DB to store persistent configuration data
 can prevent memory strain on ZooKeeper in clusters running heavy workloads.</p>