This is an automated email from the ASF dual-hosted git repository. bridgetb pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/drill-site.git
The following commit(s) were added to refs/heads/asf-site by this push: new f5ff6d9 DRILL-3610 doc update and edit f5ff6d9 is described below commit f5ff6d972bf07d315e1bd89ec6ac51f3b6fe86cd Author: Bridget Bevens <bbev...@maprtech.com> AuthorDate: Wed Dec 26 19:20:27 2018 -0800 DRILL-3610 doc update and edit --- docs/configuring-the-drill-shell/index.html | 8 +- docs/date-time-functions-and-arithmetic/index.html | 123 ++++++++++++++++++++- feed.xml | 4 +- 3 files changed, 128 insertions(+), 7 deletions(-) diff --git a/docs/configuring-the-drill-shell/index.html b/docs/configuring-the-drill-shell/index.html index e3230ba..30c076c 100644 --- a/docs/configuring-the-drill-shell/index.html +++ b/docs/configuring-the-drill-shell/index.html @@ -1291,7 +1291,7 @@ </div> - Dec 21, 2018 + Dec 27, 2018 <link href="/css/docpage.css" rel="stylesheet" type="text/css"> @@ -1382,7 +1382,7 @@ </tr> <tr> <td>!set</td> -<td>Set the given variable. See <a href="/docs/configuring-the-drill-shell/#the-set-command-variables">Set Command Variables</a>.</td> +<td>Set the given variable. See <a href="/docs/configuring-the-drill-shell/#set-command-variables">Set Command Variables</a>.</td> </tr> <tr> <td>!tables</td> @@ -1414,7 +1414,9 @@ <h2 id="set-command-variables">Set Command Variables</h2> -<p>The following table lists the set command variables that you can use with the !set command:</p> +<p>The following table lists some of the set command variables that you can use with the !set command: </p> + +<p><strong>Note:</strong> Issue the !set command without a variable to see the full list of command variables.</p> <table><thead> <tr> diff --git a/docs/date-time-functions-and-arithmetic/index.html b/docs/date-time-functions-and-arithmetic/index.html index bdd919f..33b981c 100644 --- a/docs/date-time-functions-and-arithmetic/index.html +++ b/docs/date-time-functions-and-arithmetic/index.html @@ -1293,7 +1293,7 @@ </div> - Nov 2, 2018 + Dec 27, 2018 <link href="/css/docpage.css" rel="stylesheet" type="text/css"> @@ -1361,6 +1361,18 @@ <td><a href="/docs/date-time-functions-and-arithmetic/#unix_timestamp">UNIX_TIMESTAMP</a></td> <td>BIGINT</td> </tr> +<tr> +<td><a href="/docs/date-time-functions-and-arithmetic/#TIMESTAMPADD">TIMESTAMPADD</a></td> +<td>Inferred based on unit of time</td> +</tr> +<tr> +<td><a href="/docs/date-time-functions-and-arithmetic/#TIMESTAMPDIFF">TIMESTAMPDIFF</a></td> +<td>Inferred based on unit of time</td> +</tr> +<tr> +<td></td> +<td></td> +</tr> </tbody></table> <h2 id="age">AGE</h2> @@ -1879,7 +1891,114 @@ SELECT UNIX_TIMESTAMP('2015-05-29 08:18:53.0', 'yyyy-MM-dd HH:mm:ss. +-------------+ | 1432912733 | +-------------+ -1 row selected (0.171 seconds) +1 row selected (0.171 seconds) +</code></pre></div> +<h2 id="timestampadd">TIMESTAMPADD</h2> + +<p>Adds an interval of time, in the given time units, to the date expression. </p> + +<h3 id="timestampadd-syntax">TIMESTAMPADD Syntax</h3> + +<p>TIMESTAMPADD(<em>time_unit,interval,date_expression</em>) </p> + +<h3 id="timestampadd-usage-notes">TIMESTAMPADD Usage Notes</h3> + +<ul> +<li>A date expressions is in the format YYYY-MM-DD.</li> +<li>Supports the following time units: Day, Week, Month, Quarter, Year</li> +<li>Drill uses the unit of time to infer the return type.</li> +<li><p>You can include the SQL_TSI_ prefix with the any of the supported time units, as shown: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(SQL_TSI_YEAR,3,'1982-05-06'); +</code></pre></div></li> +</ul> + +<h3 id="timestampadd-examples">TIMESTAMPADD Examples</h3> + +<p>Add three years to the given date: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(YEAR,3,'1982-05-06'); ++------------------------+ +| EXPR$0 | ++------------------------+ +| 1985-05-06 00:00:00.0 | ++------------------------+ +</code></pre></div> +<p>Add one quarter of a year (3 months) to the given date: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(QUARTER,1,'1982-05-06'); ++------------------------+ +| EXPR$0 | ++------------------------+ +| 1982-08-06 00:00:00.0 | ++------------------------+ +</code></pre></div> +<p>Add three months to the given date: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(MONTH,3,'1982-05-06'); ++------------------------+ +| EXPR$0 | ++------------------------+ +| 1982-08-06 00:00:00.0 | ++------------------------+ +</code></pre></div> +<p>Add three weeks to the given date: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(WEEK,3,'1982-05-06'); ++------------------------+ +| EXPR$0 | ++------------------------+ +| 1982-05-27 00:00:00.0 | ++------------------------+ +</code></pre></div> +<p>Add three days to the given date: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPADD(DAY,3,'1982-05-06'); ++------------------------+ +| EXPR$0 | ++------------------------+ +| 1982-05-09 00:00:00.0 | ++------------------------+ +</code></pre></div> +<h2 id="timestampdiff">TIMESTAMPDIFF</h2> + +<p>Calculates an interval of time, in the given time units, by subtracting <em>datetime_expression2</em> from <em>datetime_expression1</em>. </p> + +<h3 id="timestampdiff-syntax">TIMESTAMPDIFF Syntax</h3> + +<p>TIMESTAMPDIFF(<em>time_unit,datetime_expression1,datetime_expression2</em>) </p> + +<h3 id="timestampdiff-usage-notes">TIMESTAMPDIFF Usage Notes</h3> + +<ul> +<li>Datetime expressions are date (YYYY-MM-DD) or datetime (YYYY-MM-DD HH:MM:SS) expressions.</li> +<li>You can include two date expressions, or one date expression with one datetime expression, as shown in the examples that follow.</li> +<li>Supports the following time units: Nanosecond, Microsecond, Second, Minute, Hour, Day, Month, Year, Week, Quarter</li> +<li>Drill uses the unit of time to infer the return type.</li> +<li><p>You can include the SQL_TSI_ prefix with the any of the supported time units, as shown: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPDIFF(SQL_TSI_YEAR,'1982-05-06', '1986-05-06'); +</code></pre></div></li> +</ul> + +<h3 id="timestampdiff-examples">TIMESTAMPDIFF Examples</h3> + +<p>Subtracts 1982-05-06 from 2018-12-26 and returns the difference in months: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPDIFF(MONTH,'1982-05-06','2018-12-26'); ++---------+ +| EXPR$0 | ++---------+ +| 439 | ++---------+ +</code></pre></div> +<p>Subtracts 2003-02-01 12:05:55 from 2018-05-01 and returns the difference in minutes: </p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01 12:05:55','2018-05-01'); ++----------+ +| EXPR$0 | ++----------+ +| 8017920 | ++----------+ +</code></pre></div> +<p>Subtracts 2003-02-01 from 2018-05-01 12:05:35 and returns the difference in microseconds:</p> +<div class="highlight"><pre><code class="language-text" data-lang="text">SELECT TIMESTAMPDIFF(MICROSECOND,'2003-02-01','2018-05-01 12:05:35'); ++------------------+ +| EXPR$0 | ++------------------+ +| 481075200000000 | ++------------------+ </code></pre></div> diff --git a/feed.xml b/feed.xml index 4827d2c..df90f77 100644 --- a/feed.xml +++ b/feed.xml @@ -6,8 +6,8 @@ </description> <link>/</link> <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Fri, 21 Dec 2018 20:12:23 -0800</pubDate> - <lastBuildDate>Fri, 21 Dec 2018 20:12:23 -0800</lastBuildDate> + <pubDate>Wed, 26 Dec 2018 19:17:44 -0800</pubDate> + <lastBuildDate>Wed, 26 Dec 2018 19:17:44 -0800</lastBuildDate> <generator>Jekyll v2.5.2</generator> <item>