| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| |
| <meta name="copyright" content="(C) Copyright 2023" /> |
| <meta name="DC.rights.owner" content="(C) Copyright 2023" /> |
| <meta name="DC.Type" content="concept" /> |
| <meta name="DC.Title" content="TIMEZONE Query Option (Impala 3.1 or higher only)" /> |
| <meta name="DC.Relation" scheme="URI" content="../topics/impala_set.html" /> |
| <meta name="prodname" content="Impala" /> |
| <meta name="version" content="Impala 3.4.x" /> |
| <meta name="DC.Format" content="XHTML" /> |
| <meta name="DC.Identifier" content="timezone" /> |
| <link rel="stylesheet" type="text/css" href="../commonltr.css" /> |
| <title>TIMEZONE Query Option (Impala 3.1 or higher only)</title> |
| </head> |
| <body id="timezone"> |
| |
| |
| <h1 class="title topictitle1" id="ariaid-title1">TIMEZONE Query Option (<span class="keyword">Impala 3.1</span> or higher only)</h1> |
| |
| |
| |
| |
| |
| |
| <div class="body conbody"> |
| |
| <p class="p"> |
| The <code class="ph codeph">TIMEZONE</code> query option defines the timezone used for conversions |
| between UTC and the local time. If not set, Impala uses the system time zone where the |
| Coordinator Impalad runs. As query options are not sent to the Coordinator immediately, |
| the timezones are validated only when the query runs. |
| </p> |
| |
| |
| <div class="p"> |
| Impala takes the timezone into a consideration in the following cases: |
| <ul class="ul"> |
| <li class="li"> |
| When calling the <code class="ph codeph">NOW()</code> function |
| </li> |
| |
| |
| <li class="li"> |
| When converting between Unix time and timestamp if the |
| <code class="ph codeph">use_local_tz_for_unix_timestamp_conversions</code> flag is |
| <code class="ph codeph">TRUE</code> |
| </li> |
| |
| |
| <li class="li"> |
| When reading Parquet timestamps written by Hive if the |
| <code class="ph codeph">convert_legacy_hive_parquet_utc_timestamps</code> flag is |
| <code class="ph codeph">TRUE</code> |
| </li> |
| |
| </ul> |
| |
| </div> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Syntax:</strong> |
| </p> |
| |
| |
| <pre class="pre codeblock"><code>SET TIMEZONE=<var class="keyword varname">time zone</var></code></pre> |
| |
| <p class="p"> |
| <var class="keyword varname">time zone</var> can be a canonical code or a time zone name defined in |
| <a class="xref" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="_blank">IANA |
| Time Zone Database</a>. The value is case-sensitive. |
| </p> |
| |
| |
| <p class="p"> |
| Leading/trailing quotes (') and double quotes (") are stripped. |
| </p> |
| |
| |
| <p class="p"> |
| If <var class="keyword varname">time zone</var> is an empty string, the time zone for the query is set to |
| the default time zone of the Impalad Coordinator. |
| </p> |
| |
| |
| <p class="p"> |
| If <var class="keyword varname">time zone</var> is <code class="ph codeph">NULL</code> or a space character, Impala |
| returns an error when the query is executed. |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Type:</strong> String |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Default:</strong> The system time zone where the Coordinator Impalad runs |
| </p> |
| |
| |
| <div class="p"> |
| <strong class="ph b">Examples:</strong> |
| <pre class="pre codeblock"><code>SET TIMEZONE=UTC; |
| SET TIMEZONE="Europe/Budapest";</code></pre> |
| </div> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Added in:</strong> <span class="keyword">Impala 3.1</span> |
| </p> |
| |
| |
| </div> |
| |
| |
| <div class="related-links"> |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_set.html">SET Statement</a></div> |
| </div> |
| </div></body> |
| </html> |