| <?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="SET Statement" /> |
| <meta name="DC.Relation" scheme="URI" content="../topics/impala_langref_sql.html" /> |
| <meta name="DC.Relation" scheme="URI" content="../topics/impala_query_options.html" /> |
| <meta name="prodname" content="Impala" /> |
| <meta name="prodname" content="Impala" /> |
| <meta name="version" content="Impala 3.4.x" /> |
| <meta name="version" content="Impala 3.4.x" /> |
| <meta name="DC.Format" content="XHTML" /> |
| <meta name="DC.Identifier" content="set" /> |
| <link rel="stylesheet" type="text/css" href="../commonltr.css" /> |
| <title>SET Statement</title> |
| </head> |
| <body id="set"> |
| |
| |
| <h1 class="title topictitle1" id="ariaid-title1">SET Statement</h1> |
| |
| |
| |
| |
| |
| |
| <div class="body conbody"> |
| |
| <p class="p"> |
| The <code class="ph codeph">SET</code> statement specifies values for query options that control the |
| runtime behavior of other statements within the same session. |
| </p> |
| |
| |
| <p class="p"> |
| When issued in <code class="ph codeph">impala-shell</code>, the <code class="ph codeph">SET</code> command is |
| interpreted as an <code class="ph codeph">impala-shell</code> command that has differences from the SQL |
| <code class="ph codeph">SET</code> statement. See |
| <a class="xref" href="impala_shell_commands.html#shell_commands">impala-shell Command Reference</a> for the information about |
| the <code class="ph codeph">SET</code> command in <code class="ph codeph">impala-shell</code>. |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Syntax:</strong> |
| </p> |
| |
| |
| <pre class="pre codeblock"><code>SET |
| <span class="ph">SET ALL</span> |
| SET <var class="keyword varname">query_option</var>=<var class="keyword varname">option_value</var> |
| SET <var class="keyword varname">query_option</var>="" |
| </code></pre> |
| |
| <p class="p"> |
| <code class="ph codeph">SET</code> and <code class="ph codeph">SET ALL</code> with no arguments return a result set |
| consisting of all the applicable query options and their current values. |
| </p> |
| |
| |
| <p class="p"> |
| The <var class="keyword varname">query_option</var> and <var class="keyword varname">option_value</var> are |
| case-insensitive. |
| </p> |
| |
| |
| <p class="p"> |
| Unlike the <code class="ph codeph">impala-shell</code> command version of <code class="ph codeph">SET</code>, when |
| used as a SQL statement, the string values for <var class="keyword varname">option_value</var> need to be |
| quoted, e.g. <code class="ph codeph">SET option="new_value"</code>. |
| </p> |
| |
| |
| <p class="p"> |
| The <code class="ph codeph">SET <var class="keyword varname">query_option</var> = ""</code> statement unsets the value |
| of the <var class="keyword varname">query_option</var> in the current session, reverting it to the default |
| state. In <code class="ph codeph">impala-shell</code>, use the <code class="ph codeph">UNSET</code> command to set a |
| query option to it default. |
| </p> |
| |
| |
| <p class="p"> |
| Each query option has a specific allowed notation for its arguments. See |
| <a class="xref" href="impala_query_options.html#query_options">Query Options for the SET Statement</a> for the details of each query |
| option. |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Usage notes:</strong> |
| </p> |
| |
| |
| <p class="p"> |
| In <span class="keyword">Impala 2.11</span> and higher, the outputs of the <code class="ph codeph">SET</code> |
| and <code class="ph codeph">SET ALL</code> statements were reorganized as below: |
| </p> |
| |
| |
| <ul class="ul"> |
| <li class="li"> |
| <p class="p"> |
| The options are divided into groups: <code class="ph codeph">Regular Query Options</code>, |
| <code class="ph codeph">Advanced Query Options</code>, <code class="ph codeph">Development Query Options</code>, |
| and <code class="ph codeph">Deprecated Query Options</code>. |
| </p> |
| |
| <ul class="ul"> |
| <li class="li"> |
| <p class="p"> |
| The advanced options are intended for use in specific kinds of performance tuning |
| and debugging scenarios. |
| </p> |
| |
| </li> |
| |
| |
| <li class="li"> |
| <p class="p"> |
| The development options are related to internal development of Impala or features |
| that are not yet finalized. These options might be changed or removed without |
| notice. |
| </p> |
| |
| </li> |
| |
| |
| <li class="li"> |
| <p class="p"> |
| The deprecated options are related to features that are removed or changed so that |
| the options no longer have any purpose. These options might be removed in future |
| versions. |
| </p> |
| |
| </li> |
| |
| </ul> |
| |
| </li> |
| |
| |
| <li class="li"> |
| <p class="p"> |
| By default, only the first two groups, regular and advanced, are displayed by the |
| <code class="ph codeph">SET</code> command. Use <code class="ph codeph">SET ALL</code> to see all groups of |
| options. |
| </p> |
| |
| </li> |
| |
| |
| <li class="li"> |
| <p class="p"> |
| <span class="keyword cmdname">impala-shell</span> options and user-specified variables are always |
| displayed at the end of the list of query options, after all appropriate option |
| groups. |
| </p> |
| |
| </li> |
| |
| </ul> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Added in:</strong> <span class="keyword">Impala 2.0.0</span> |
| </p> |
| |
| |
| <p class="p"> |
| <code class="ph codeph">SET</code> has always been available as an <span class="keyword cmdname">impala-shell</span> |
| command. Promoting it to a SQL statement lets you use this feature in client applications |
| through the JDBC and ODBC APIs. |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">HDFS permissions:</strong> This statement does not touch any HDFS files or directories, |
| therefore no HDFS permissions are required. |
| </p> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Related information:</strong> |
| </p> |
| |
| |
| <p class="p"> |
| See <a class="xref" href="impala_query_options.html#query_options">Query Options for the SET Statement</a> for the query options you can |
| adjust using this statement. |
| </p> |
| |
| |
| </div> |
| |
| |
| <div class="related-links"> |
| <ul class="ullinks"> |
| <li class="link ulchildlink"><strong><a href="../topics/impala_query_options.html">Query Options for the SET Statement</a></strong><br /> |
| </li> |
| </ul> |
| |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_langref_sql.html">Impala SQL Statements</a></div> |
| </div> |
| </div></body> |
| </html> |