This is an automated email from the ASF dual-hosted git repository.
git-site-role 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 aa5ebe3b1 Automatic Site Publish by Buildbot
aa5ebe3b1 is described below
commit aa5ebe3b10e6118bd3cc020e9836b374957e0893
Author: buildbot <[email protected]>
AuthorDate: Fri Nov 4 15:14:20 2022 +0000
Automatic Site Publish by Buildbot
---
.../date-time-functions-and-arithmetic/index.html | 70 ++++++++++++++++++++++
output/feed.xml | 4 +-
.../date-time-functions-and-arithmetic/index.html | 70 ++++++++++++++++++++++
output/zh/feed.xml | 4 +-
4 files changed, 144 insertions(+), 4 deletions(-)
diff --git a/output/docs/date-time-functions-and-arithmetic/index.html
b/output/docs/date-time-functions-and-arithmetic/index.html
index 4902805a9..6489f08d2 100644
--- a/output/docs/date-time-functions-and-arithmetic/index.html
+++ b/output/docs/date-time-functions-and-arithmetic/index.html
@@ -1512,6 +1512,10 @@
<td><a
href="/docs/date-time-functions-and-arithmetic/#date_sub">DATE_SUB</a></td>
<td>DATE, TIMESTAMP</td>
</tr>
+ <tr>
+ <td><a
href="/docs/date-time-functions-and-arithmetic/#date_trunc">DATE_TRUNC</a></td>
+ <td>DATE, TIMESTAMP</td>
+ </tr>
<tr>
<td><a href="/docs/date-time-functions-and-arithmetic/#day">DAY</a></td>
<td>BIGINT</td>
@@ -2051,6 +2055,72 @@ SELECT DATE_PART('hour', '23:14:30.076') FROM
(VALUES(1));
2 rows selected (0.161 seconds)
</code></pre></div></div>
+<h2 id="date_trunc">DATE_TRUNC</h2>
+<p>Rounds or truncates a date or timestamp to the interval you need. When used
to aggregate data, it allows you to find time-based trends like daily purchases
or messages per second.</p>
+
+<p>The <code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
function can return either a <code class="language-plaintext
highlighter-rouge">date</code>, <code class="language-plaintext
highlighter-rouge">timestamp</code>, <code class="language-plaintext
highlighter-rouge">time</code> or <code class="language-plaintext
highlighter-rouge">interval</code>.</p>
+
+<h3 id="date_trunc-syntax">DATE_TRUNC Syntax</h3>
+
+<p><code class="language-plaintext
highlighter-rouge">DATE_TRUNC(time_increment, expr)</code>
+<code class="language-plaintext highlighter-rouge">DATE_TRUNC(time_increment,
keyword expr)</code>
+<code class="language-plaintext highlighter-rouge">DATE_TRUNC(time_increment,
interval interval_expr TO time_increment)</code></p>
+
+<p><em>time_increment</em> is the time increment to which you would like to
round the datetime. It must be one of the options listed below and enclosed by
single quotes.
+<em>keyword</em> is the word <code class="language-plaintext
highlighter-rouge">date</code>, <code class="language-plaintext
highlighter-rouge">time</code>, or <code class="language-plaintext
highlighter-rouge">timestamp</code>. This corresponds to the desired return
type.
+<em>interval</em> is the word <code class="language-plaintext
highlighter-rouge">interval</code>
+<em>interval_expr</em> is an interval expression
+<em>column</em> is date, time, or timestamp data in the data source.
+<em>expr</em> is an time expression, such as the name of a data source column
containing temporal data, or a string.</p>
+
+<ul>
+ <li>Second</li>
+ <li>Minute</li>
+ <li>Hour</li>
+ <li>Day</li>
+ <li>Month</li>
+ <li>Quarter</li>
+ <li>Year</li>
+ <li>Decade</li>
+ <li>Century</li>
+ <li>Millennium</li>
+</ul>
+
+<h3 id="date_trunc-examples">DATE_TRUNC Examples</h3>
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
returning dates truncated to specific increments:</p>
+
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>SELECT date_trunc('DECADE',
+date '1983-05-18') AS decade,
+date_trunc('YEAR', date '1983-05-18') AS `year`,
+date_trunc('QUARTER', date '1983-05-18') AS quarter, date_trunc('WEEK', date
'1983-05-18') AS week;
++------------+------------+------------+------------+
+| decade | year | quarter | week |
++------------+------------+------------+------------+
+| 1980-01-01 | 1983-01-01 | 1983-04-01 | 1983-05-16 |
++------------+------------+------------+------------+
+</code></pre></div></div>
+
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
returning timestamps truncated to specific increments:</p>
+
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>SELECT date_trunc('HOUR', timestamp '1983-05-18
10:14:00') AS HOUR;
++-----------------------+
+| HOUR |
++-----------------------+
+| 1983-05-18 10:00:00.0 |
++-----------------------+
+</code></pre></div></div>
+
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
example using an interval.</p>
+
+ SELECT date_trunc(‘YEAR’, interval ‘217-7’ year(3) to month) as <code
class="language-plaintext highlighter-rouge">year</code>,
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>date_trunc('DECADE', interval '217-7' year(3) to month)
AS `decade`;
++--------------------+--------------------+
+| year | decade |
++--------------------+--------------------+
+| 217 years 0 months | 210 years 0 months |
++--------------------+--------------------+
+</code></pre></div></div>
+
<h2 id="day">DAY</h2>
<p>Returns the day portion of a date/time. Also accepts a string as input.</p>
diff --git a/output/feed.xml b/output/feed.xml
index 88dd1937d..5283692bd 100644
--- a/output/feed.xml
+++ b/output/feed.xml
@@ -6,8 +6,8 @@
</description>
<link>/</link>
<atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
- <pubDate>Sun, 30 Oct 2022 00:54:32 +0000</pubDate>
- <lastBuildDate>Sun, 30 Oct 2022 00:54:32 +0000</lastBuildDate>
+ <pubDate>Fri, 04 Nov 2022 15:12:15 +0000</pubDate>
+ <lastBuildDate>Fri, 04 Nov 2022 15:12:15 +0000</lastBuildDate>
<generator>Jekyll v3.9.1</generator>
<item>
diff --git a/output/zh/docs/date-time-functions-and-arithmetic/index.html
b/output/zh/docs/date-time-functions-and-arithmetic/index.html
index 57c3af233..c68f6740f 100644
--- a/output/zh/docs/date-time-functions-and-arithmetic/index.html
+++ b/output/zh/docs/date-time-functions-and-arithmetic/index.html
@@ -1512,6 +1512,10 @@
<td><a
href="/zh/docs/date-time-functions-and-arithmetic/#date_sub">DATE_SUB</a></td>
<td>DATE, TIMESTAMP</td>
</tr>
+ <tr>
+ <td><a
href="/zh/docs/date-time-functions-and-arithmetic/#date_trunc">DATE_TRUNC</a></td>
+ <td>DATE, TIMESTAMP</td>
+ </tr>
<tr>
<td><a
href="/zh/docs/date-time-functions-and-arithmetic/#day">DAY</a></td>
<td>BIGINT</td>
@@ -2051,6 +2055,72 @@ SELECT DATE_PART('hour', '23:14:30.076') FROM
(VALUES(1));
2 rows selected (0.161 seconds)
</code></pre></div></div>
+<h2 id="date_trunc">DATE_TRUNC</h2>
+<p>Rounds or truncates a date or timestamp to the interval you need. When used
to aggregate data, it allows you to find time-based trends like daily purchases
or messages per second.</p>
+
+<p>The <code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
function can return either a <code class="language-plaintext
highlighter-rouge">date</code>, <code class="language-plaintext
highlighter-rouge">timestamp</code>, <code class="language-plaintext
highlighter-rouge">time</code> or <code class="language-plaintext
highlighter-rouge">interval</code>.</p>
+
+<h3 id="date_trunc-syntax">DATE_TRUNC Syntax</h3>
+
+<p><code class="language-plaintext
highlighter-rouge">DATE_TRUNC(time_increment, expr)</code>
+<code class="language-plaintext highlighter-rouge">DATE_TRUNC(time_increment,
keyword expr)</code>
+<code class="language-plaintext highlighter-rouge">DATE_TRUNC(time_increment,
interval interval_expr TO time_increment)</code></p>
+
+<p><em>time_increment</em> is the time increment to which you would like to
round the datetime. It must be one of the options listed below and enclosed by
single quotes.
+<em>keyword</em> is the word <code class="language-plaintext
highlighter-rouge">date</code>, <code class="language-plaintext
highlighter-rouge">time</code>, or <code class="language-plaintext
highlighter-rouge">timestamp</code>. This corresponds to the desired return
type.
+<em>interval</em> is the word <code class="language-plaintext
highlighter-rouge">interval</code>
+<em>interval_expr</em> is an interval expression
+<em>column</em> is date, time, or timestamp data in the data source.
+<em>expr</em> is an time expression, such as the name of a data source column
containing temporal data, or a string.</p>
+
+<ul>
+ <li>Second</li>
+ <li>Minute</li>
+ <li>Hour</li>
+ <li>Day</li>
+ <li>Month</li>
+ <li>Quarter</li>
+ <li>Year</li>
+ <li>Decade</li>
+ <li>Century</li>
+ <li>Millennium</li>
+</ul>
+
+<h3 id="date_trunc-examples">DATE_TRUNC Examples</h3>
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
returning dates truncated to specific increments:</p>
+
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>SELECT date_trunc('DECADE',
+date '1983-05-18') AS decade,
+date_trunc('YEAR', date '1983-05-18') AS `year`,
+date_trunc('QUARTER', date '1983-05-18') AS quarter, date_trunc('WEEK', date
'1983-05-18') AS week;
++------------+------------+------------+------------+
+| decade | year | quarter | week |
++------------+------------+------------+------------+
+| 1980-01-01 | 1983-01-01 | 1983-04-01 | 1983-05-16 |
++------------+------------+------------+------------+
+</code></pre></div></div>
+
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
returning timestamps truncated to specific increments:</p>
+
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>SELECT date_trunc('HOUR', timestamp '1983-05-18
10:14:00') AS HOUR;
++-----------------------+
+| HOUR |
++-----------------------+
+| 1983-05-18 10:00:00.0 |
++-----------------------+
+</code></pre></div></div>
+
+<p><code class="language-plaintext highlighter-rouge">DATE_TRUNC</code>
example using an interval.</p>
+
+ SELECT date_trunc(‘YEAR’, interval ‘217-7’ year(3) to month) as <code
class="language-plaintext highlighter-rouge">year</code>,
+<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre
class="highlight"><code>date_trunc('DECADE', interval '217-7' year(3) to month)
AS `decade`;
++--------------------+--------------------+
+| year | decade |
++--------------------+--------------------+
+| 217 years 0 months | 210 years 0 months |
++--------------------+--------------------+
+</code></pre></div></div>
+
<h2 id="day">DAY</h2>
<p>Returns the day portion of a date/time. Also accepts a string as input.</p>
diff --git a/output/zh/feed.xml b/output/zh/feed.xml
index e0b361066..694ca5d68 100644
--- a/output/zh/feed.xml
+++ b/output/zh/feed.xml
@@ -6,8 +6,8 @@
</description>
<link>/</link>
<atom:link href="/zh/feed.xml" rel="self" type="application/rss+xml"/>
- <pubDate>Sun, 30 Oct 2022 00:54:32 +0000</pubDate>
- <lastBuildDate>Sun, 30 Oct 2022 00:54:32 +0000</lastBuildDate>
+ <pubDate>Fri, 04 Nov 2022 15:12:15 +0000</pubDate>
+ <lastBuildDate>Fri, 04 Nov 2022 15:12:15 +0000</lastBuildDate>
<generator>Jekyll v3.9.1</generator>
<item>