You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2018/05/09 21:10:53 UTC
[44/51] [partial] impala git commit: [DOCS] Impala doc site update
for 3.0
http://git-wip-us.apache.org/repos/asf/impala/blob/fae51ec2/docs/build3x/html/topics/impala_breakpad.html
----------------------------------------------------------------------
diff --git a/docs/build3x/html/topics/impala_breakpad.html b/docs/build3x/html/topics/impala_breakpad.html
new file mode 100644
index 0000000..eb59388
--- /dev/null
+++ b/docs/build3x/html/topics/impala_breakpad.html
@@ -0,0 +1,239 @@
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><meta name="DC.Relation" scheme="URI" content="../topics/impala_troubleshooting.html"><meta name="prodname" content="Impala"><meta name="prodname" content="Impala"><meta name="version" content="Impala 3.0.x"><meta name="version" content="Impala 3.0.x"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="breakpad"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Breakpad Minidumps for Impala (Impala 2.6 or higher only)</title></head><body id="breakpad"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
+
+ <h1 class="title topictitle1" id="ariaid-title1">Breakpad Minidumps for Impala (<span class="keyword">Impala 2.6</span> or higher only)</h1>
+
+
+
+ <div class="body conbody">
+
+ <p class="p">
+ The <a class="xref" href="https://chromium.googlesource.com/breakpad/breakpad/" target="_blank">breakpad</a>
+ project is an open-source framework for crash reporting.
+ In <span class="keyword">Impala 2.6</span> and higher, Impala can use <code class="ph codeph">breakpad</code> to record stack information and
+ register values when any of the Impala-related daemons crash due to an error such as <code class="ph codeph">SIGSEGV</code>
+ or unhandled exceptions.
+ The dump files are much smaller than traditional core dump files. The dump mechanism itself uses very little
+ memory, which improves reliability if the crash occurs while the system is low on memory.
+ </p>
+
+ <div class="note important note_important"><span class="note__title importanttitle">Important:</span>
+ Because of the internal mechanisms involving Impala memory allocation and Linux
+ signalling for out-of-memory (OOM) errors, if an Impala-related daemon experiences a
+ crash due to an OOM condition, it does <em class="ph i">not</em> generate a minidump for that error.
+ <p class="p">
+
+ </p>
+ </div>
+
+
+ <p class="p toc inpage"></p>
+
+ </div>
+
+ <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_troubleshooting.html">Troubleshooting Impala</a></div></div></nav><article class="topic concept nested1" aria-labelledby="ariaid-title2" id="breakpad__breakpad_minidump_enable">
+ <h2 class="title topictitle2" id="ariaid-title2">Enabling or Disabling Minidump Generation</h2>
+ <div class="body conbody">
+ <p class="p">
+ By default, a minidump file is generated when an Impala-related daemon
+ crashes.
+ </p>
+
+ <div class="p">
+ To turn off generation of the minidump files, use one of the following
+ options:
+
+ <ul class="ul">
+ <li class="li">
+ Set the <code class="ph codeph">--enable_minidumps</code> configuration setting
+ to <code class="ph codeph">false</code>. Restart the corresponding services or
+ daemons.
+ </li>
+
+ <li class="li">
+ Set the <code class="ph codeph">--minidump_path</code> configuration setting to
+ an empty string. Restart the corresponding services or daemons.
+ </li>
+ </ul>
+ </div>
+
+ <p class="p">
+ In <span class="keyword">Impala 2.7</span> and higher,
+ you can send a <code class="ph codeph">SIGUSR1</code> signal to any Impala-related daemon to write a
+ Breakpad minidump. For advanced troubleshooting, you can now produce a minidump
+ without triggering a crash.
+ </p>
+ </div>
+ </article>
+
+ <article class="topic concept nested1" aria-labelledby="ariaid-title3" id="breakpad__breakpad_minidump_location">
+ <h2 class="title topictitle2" id="ariaid-title3">Specifying the Location for Minidump Files</h2>
+ <div class="body conbody">
+ <div class="p">
+ By default, all minidump files are written to the following location
+ on the host where a crash occurs:
+
+ <ul class="ul">
+ <li class="li">
+ <p class="p">
+ Clusters not managed by cluster management software:
+ <span class="ph filepath"><var class="keyword varname">impala_log_dir</var>/<var class="keyword varname">daemon_name</var>/minidumps/<var class="keyword varname">daemon_name</var></span>
+ </p>
+ </li>
+ </ul>
+ The minidump files for <span class="keyword cmdname">impalad</span>, <span class="keyword cmdname">catalogd</span>,
+ and <span class="keyword cmdname">statestored</span> are each written to a separate directory.
+ </div>
+ <p class="p">
+ To specify a different location, set the
+
+ <span class="ph uicontrol">minidump_path</span>
+ configuration setting of one or more Impala-related daemons, and restart the corresponding services or daemons.
+ </p>
+ <p class="p">
+ If you specify a relative path for this setting, the value is interpreted relative to
+ the default <span class="ph uicontrol">minidump_path</span> directory.
+ </p>
+ </div>
+ </article>
+
+ <article class="topic concept nested1" aria-labelledby="ariaid-title4" id="breakpad__breakpad_minidump_number">
+ <h2 class="title topictitle2" id="ariaid-title4">Controlling the Number of Minidump Files</h2>
+ <div class="body conbody">
+ <p class="p">
+ Like any files used for logging or troubleshooting, consider limiting the number of
+ minidump files, or removing unneeded ones, depending on the amount of free storage
+ space on the hosts in the cluster.
+ </p>
+ <p class="p">
+ Because the minidump files are only used for problem resolution, you can remove any such files that
+ are not needed to debug current issues.
+ </p>
+ <p class="p">
+ To control how many minidump files Impala keeps around at any one time,
+ set the <span class="ph uicontrol">max_minidumps</span> configuration setting for
+ of one or more Impala-related daemon, and restart the corresponding services or daemons.
+ The default for this setting is 9. A zero or negative value is interpreted as
+ <span class="q">"unlimited"</span>.
+ </p>
+ </div>
+ </article>
+
+ <article class="topic concept nested1" aria-labelledby="ariaid-title5" id="breakpad__breakpad_minidump_logging">
+ <h2 class="title topictitle2" id="ariaid-title5">Detecting Crash Events</h2>
+ <div class="body conbody">
+
+ <p class="p">
+ You can see in the Impala log files when crash events occur that generate
+ minidump files. Because each restart begins a new log file, the <span class="q">"crashed"</span> message
+ is always at or near the bottom of the log file. There might be another later message
+ if core dumps are also enabled.
+ </p>
+
+ </div>
+ </article>
+
+ <article class="topic concept nested1" aria-labelledby="ariaid-title6" id="breakpad__breakpad_demo">
+ <h2 class="title topictitle2" id="ariaid-title6">Demonstration of Breakpad Feature</h2>
+ <div class="body conbody">
+ <p class="p">
+ The following example uses the command <span class="keyword cmdname">kill -11</span> to
+ simulate a <code class="ph codeph">SIGSEGV</code> crash for an <span class="keyword cmdname">impalad</span>
+ process on a single DataNode, then examines the relevant log files and minidump file.
+ </p>
+
+ <p class="p">
+ First, as root on a worker node, kill the <span class="keyword cmdname">impalad</span> process with a
+ <code class="ph codeph">SIGSEGV</code> error. The original process ID was 23114.
+ </p>
+
+<pre class="pre codeblock"><code>
+# ps ax | grep impalad
+23114 ? Sl 0:18 /opt/local/parcels/<parcel_version>/lib/impala/sbin/impalad --flagfile=/var/run/impala/process/114-impala-IMPALAD/impala-conf/impalad_flags
+31259 pts/0 S+ 0:00 grep impalad
+#
+# kill -11 23114
+#
+# ps ax | grep impalad
+31374 ? Rl 0:04 /opt/local/parcels/<parcel_version>/lib/impala/sbin/impalad --flagfile=/var/run/impala/process/114-impala-IMPALAD/impala-conf/impalad_flags
+31475 pts/0 S+ 0:00 grep impalad
+
+</code></pre>
+
+ <p class="p">
+ We locate the log directory underneath <span class="ph filepath">/var/log</span>.
+ There is a <code class="ph codeph">.INFO</code>, <code class="ph codeph">.WARNING</code>, and <code class="ph codeph">.ERROR</code>
+ log file for the 23114 process ID. The minidump message is written to the
+ <code class="ph codeph">.INFO</code> file and the <code class="ph codeph">.ERROR</code> file, but not the
+ <code class="ph codeph">.WARNING</code> file. In this case, a large core file was also produced.
+ </p>
+<pre class="pre codeblock"><code>
+# cd /var/log/impalad
+# ls -la | grep 23114
+-rw------- 1 impala impala 3539079168 Jun 23 15:20 core.23114
+-rw-r--r-- 1 impala impala 99057 Jun 23 15:20 hs_err_pid23114.log
+-rw-r--r-- 1 impala impala 351 Jun 23 15:20 impalad.worker_node_123.impala.log.ERROR.20160623-140343.23114
+-rw-r--r-- 1 impala impala 29101 Jun 23 15:20 impalad.worker_node_123.impala.log.INFO.20160623-140343.23114
+-rw-r--r-- 1 impala impala 228 Jun 23 14:03 impalad.worker_node_123.impala.log.WARNING.20160623-140343.23114
+
+</code></pre>
+ <p class="p">
+ The <code class="ph codeph">.INFO</code> log includes the location of the minidump file, followed by
+ a report of a core dump. With the breakpad minidump feature enabled, now we might
+ disable core dumps or keep fewer of them around.
+ </p>
+<pre class="pre codeblock"><code>
+# cat impalad.worker_node_123.impala.log.INFO.20160623-140343.23114
+...
+Wrote minidump to /var/log/impala-minidumps/impalad/0980da2d-a905-01e1-25ff883a-04ee027a.dmp
+#
+# A fatal error has been detected by the Java Runtime Environment:
+#
+# SIGSEGV (0xb) at pc=0x00000030c0e0b68a, pid=23114, tid=139869541455968
+#
+# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
+# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
+# Problematic frame:
+# C [libpthread.so.0+0xb68a] pthread_cond_wait+0xca
+#
+# Core dump written. Default location: /var/log/impalad/core or core.23114
+#
+# An error report file with more information is saved as:
+# /var/log/impalad/hs_err_pid23114.log
+#
+# If you would like to submit a bug report, please visit:
+# http://bugreport.sun.com/bugreport/crash.jsp
+# The crash happened outside the Java Virtual Machine in native code.
+# See problematic frame for where to report the bug.
+...
+
+# cat impalad.worker_node_123.impala.log.ERROR.20160623-140343.23114
+
+Log file created at: 2016/06/23 14:03:43
+Running on machine:.worker_node_123
+Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
+E0623 14:03:43.911002 23114 logging.cc:118] stderr will be logged to this file.
+Wrote minidump to /var/log/impala-minidumps/impalad/0980da2d-a905-01e1-25ff883a-04ee027a.dmp
+
+</code></pre>
+
+ <p class="p">
+ The resulting minidump file is much smaller than the corresponding core file,
+ making it much easier to supply diagnostic information to <span class="keyword">the appropriate support channel</span>.
+ </p>
+
+<pre class="pre codeblock"><code>
+# pwd
+/var/log/impalad
+# cd ../impala-minidumps/impalad
+# ls
+0980da2d-a905-01e1-25ff883a-04ee027a.dmp
+# du -kh *
+2.4M 0980da2d-a905-01e1-25ff883a-04ee027a.dmp
+
+</code></pre>
+ </div>
+ </article>
+
+</article></main></body></html>
http://git-wip-us.apache.org/repos/asf/impala/blob/fae51ec2/docs/build3x/html/topics/impala_buffer_pool_limit.html
----------------------------------------------------------------------
diff --git a/docs/build3x/html/topics/impala_buffer_pool_limit.html b/docs/build3x/html/topics/impala_buffer_pool_limit.html
new file mode 100644
index 0000000..e9406b7
--- /dev/null
+++ b/docs/build3x/html/topics/impala_buffer_pool_limit.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><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.0.x"><meta name="version" content="Impala 3.0.x"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="buffer_pool_limit"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>BUFFER_POOL_LIMIT Query Option</title></head><body id="buffer_pool_limit"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
+
+ <h1 class="title topictitle1" id="ariaid-title1">BUFFER_POOL_LIMIT Query Option</h1>
+
+
+
+ <div class="body conbody">
+
+ <p class="p">
+
+ Defines a limit on the amount of memory that a query can allocate from the
+ internal buffer pool. The value for this limit applies to the memory on each host,
+ not the aggregate memory across the cluster. Typically not changed by users, except
+ during diagnosis of out-of-memory errors during queries.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Type:</strong> integer
+ </p>
+
+
+
+ <p class="p">
+ <strong class="ph b">Default:</strong>
+ </p>
+ <p class="p">
+ The default setting for this option is the lower of 80% of the
+ <code class="ph codeph">MEM_LIMIT</code> setting, or the <code class="ph codeph">MEM_LIMIT</code>
+ setting minus 100 MB.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Added in:</strong> <span class="keyword">Impala 2.10.0</span>
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Usage notes:</strong>
+ </p>
+ <p class="p">
+ If queries encounter out-of-memory errors, consider decreasing the
+ <code class="ph codeph">BUFFER_POOL_LIMIT</code> setting to less than 80% of the
+ <code class="ph codeph">MEM_LIMIT setting</code>.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Examples:</strong>
+ </p>
+
+<pre class="pre codeblock"><code>
+-- Set an absolute value.
+set buffer_pool_limit=8GB;
+
+-- Set a relative value based on the MEM_LIMIT setting.
+set buffer_pool_limit=80%;
+
+</code></pre>
+
+ <p class="p">
+ <strong class="ph b">Related information:</strong>
+ </p>
+ <p class="p">
+ <a class="xref" href="impala_default_spillable_buffer_size.html">DEFAULT_SPILLABLE_BUFFER_SIZE Query Option</a>,
+ <a class="xref" href="impala_max_row_size.html">MAX_ROW_SIZE Query Option</a>,
+ <a class="xref" href="impala_min_spillable_buffer_size.html">MIN_SPILLABLE_BUFFER_SIZE Query Option</a>,
+ <a class="xref" href="impala_scalability.html">Scalability Considerations for Impala</a>
+ </p>
+
+ </div>
+<nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_query_options.html">Query Options for the SET Statement</a></div></div></nav></article></main></body></html>
http://git-wip-us.apache.org/repos/asf/impala/blob/fae51ec2/docs/build3x/html/topics/impala_char.html
----------------------------------------------------------------------
diff --git a/docs/build3x/html/topics/impala_char.html b/docs/build3x/html/topics/impala_char.html
new file mode 100644
index 0000000..6441539
--- /dev/null
+++ b/docs/build3x/html/topics/impala_char.html
@@ -0,0 +1,305 @@
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><meta name="DC.Relation" scheme="URI" content="../topics/impala_datatypes.html"><meta name="prodname" content="Impala"><meta name="prodname" content="Impala"><meta name="version" content="Impala 3.0.x"><meta name="version" content="Impala 3.0.x"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="char"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>CHAR Data Type (Impala 2.0 or higher only)</title></head><body id="char"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
+
+ <h1 class="title topictitle1" id="ariaid-title1">CHAR Data Type (<span class="keyword">Impala 2.0</span> or higher only)</h1>
+
+
+
+ <div class="body conbody">
+
+ <p class="p">
+
+ A fixed-length character type, padded with trailing spaces if necessary to achieve the specified length. If
+ values are longer than the specified length, Impala truncates any trailing characters.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Syntax:</strong>
+ </p>
+
+ <p class="p">
+ In the column definition of a <code class="ph codeph">CREATE TABLE</code> statement:
+ </p>
+
+<pre class="pre codeblock"><code><var class="keyword varname">column_name</var> CHAR(<var class="keyword varname">length</var>)</code></pre>
+
+ <p class="p">
+ The maximum length you can specify is 255.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Semantics of trailing spaces:</strong>
+ </p>
+
+ <ul class="ul">
+ <li class="li">
+ When you store a <code class="ph codeph">CHAR</code> value shorter than the specified length in a table, queries return
+ the value padded with trailing spaces if necessary; the resulting value has the same length as specified in
+ the column definition.
+ </li>
+
+ <li class="li">
+ If you store a <code class="ph codeph">CHAR</code> value containing trailing spaces in a table, those trailing spaces are
+ not stored in the data file. When the value is retrieved by a query, the result could have a different
+ number of trailing spaces. That is, the value includes however many spaces are needed to pad it to the
+ specified length of the column.
+ </li>
+
+ <li class="li">
+ If you compare two <code class="ph codeph">CHAR</code> values that differ only in the number of trailing spaces, those
+ values are considered identical.
+ </li>
+ </ul>
+
+ <p class="p">
+ <strong class="ph b">Partitioning:</strong> This type can be used for partition key columns. Because of the efficiency advantage
+ of numeric values over character-based values, if the partition key is a string representation of a number,
+ prefer to use an integer type with sufficient range (<code class="ph codeph">INT</code>, <code class="ph codeph">BIGINT</code>, and so
+ on) where practical.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">HBase considerations:</strong> This data type cannot be used with HBase tables.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Parquet considerations:</strong>
+ </p>
+
+ <ul class="ul">
+ <li class="li">
+ This type can be read from and written to Parquet files.
+ </li>
+
+ <li class="li">
+ There is no requirement for a particular level of Parquet.
+ </li>
+
+ <li class="li">
+ Parquet files generated by Impala and containing this type can be freely interchanged with other components
+ such as Hive and MapReduce.
+ </li>
+
+ <li class="li">
+ Any trailing spaces, whether implicitly or explicitly specified, are not written to the Parquet data files.
+ </li>
+
+ <li class="li">
+ Parquet data files might contain values that are longer than allowed by the
+ <code class="ph codeph">CHAR(<var class="keyword varname">n</var>)</code> length limit. Impala ignores any extra trailing characters when
+ it processes those values during a query.
+ </li>
+ </ul>
+
+ <p class="p">
+ <strong class="ph b">Text table considerations:</strong>
+ </p>
+
+ <p class="p">
+ Text data files might contain values that are longer than allowed for a particular
+ <code class="ph codeph">CHAR(<var class="keyword varname">n</var>)</code> column. Any extra trailing characters are ignored when Impala
+ processes those values during a query. Text data files can also contain values that are shorter than the
+ defined length limit, and Impala pads them with trailing spaces up to the specified length. Any text data
+ files produced by Impala <code class="ph codeph">INSERT</code> statements do not include any trailing blanks for
+ <code class="ph codeph">CHAR</code> columns.
+ </p>
+
+ <p class="p"><strong class="ph b">Avro considerations:</strong></p>
+ <p class="p">
+ The Avro specification allows string values up to 2**64 bytes in length.
+ Impala queries for Avro tables use 32-bit integers to hold string lengths.
+ In <span class="keyword">Impala 2.5</span> and higher, Impala truncates <code class="ph codeph">CHAR</code>
+ and <code class="ph codeph">VARCHAR</code> values in Avro tables to (2**31)-1 bytes.
+ If a query encounters a <code class="ph codeph">STRING</code> value longer than (2**31)-1
+ bytes in an Avro table, the query fails. In earlier releases,
+ encountering such long values in an Avro table could cause a crash.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Compatibility:</strong>
+ </p>
+
+ <p class="p">
+ This type is available using <span class="keyword">Impala 2.0</span> or higher.
+ </p>
+
+ <p class="p">
+ Some other database systems make the length specification optional. For Impala, the length is required.
+ </p>
+
+
+
+ <p class="p">
+ <strong class="ph b">Internal details:</strong> Represented in memory as a byte array with the same size as the length
+ specification. Values that are shorter than the specified length are padded on the right with trailing
+ spaces.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Added in:</strong> <span class="keyword">Impala 2.0.0</span>
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Column statistics considerations:</strong> Because this type has a fixed size, the maximum and average size
+ fields are always filled in for column statistics, even before you run the <code class="ph codeph">COMPUTE STATS</code>
+ statement.
+ </p>
+
+
+
+ <p class="p">
+ <strong class="ph b">UDF considerations:</strong> This type cannot be used for the argument or return type of a user-defined
+ function (UDF) or user-defined aggregate function (UDA).
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Examples:</strong>
+ </p>
+
+ <p class="p">
+ These examples show how trailing spaces are not considered significant when comparing or processing
+ <code class="ph codeph">CHAR</code> values. <code class="ph codeph">CAST()</code> truncates any longer string to fit within the defined
+ length. If a <code class="ph codeph">CHAR</code> value is shorter than the specified length, it is padded on the right with
+ spaces until it matches the specified length. Therefore, <code class="ph codeph">LENGTH()</code> represents the length
+ including any trailing spaces, and <code class="ph codeph">CONCAT()</code> also treats the column value as if it has
+ trailing spaces.
+ </p>
+
+<pre class="pre codeblock"><code>select cast('x' as char(4)) = cast('x ' as char(4)) as "unpadded equal to padded";
++--------------------------+
+| unpadded equal to padded |
++--------------------------+
+| true |
++--------------------------+
+
+create table char_length(c char(3));
+insert into char_length values (cast('1' as char(3))), (cast('12' as char(3))), (cast('123' as char(3))), (cast('123456' as char(3)));
+select concat("[",c,"]") as c, length(c) from char_length;
++-------+-----------+
+| c | length(c) |
++-------+-----------+
+| [1 ] | 3 |
+| [12 ] | 3 |
+| [123] | 3 |
+| [123] | 3 |
++-------+-----------+
+</code></pre>
+
+ <p class="p">
+ This example shows a case where data values are known to have a specific length, where <code class="ph codeph">CHAR</code>
+ is a logical data type to use.
+
+ </p>
+
+<pre class="pre codeblock"><code>create table addresses
+ (id bigint,
+ street_name string,
+ state_abbreviation char(2),
+ country_abbreviation char(2));
+</code></pre>
+
+ <p class="p">
+ The following example shows how values written by Impala do not physically include the trailing spaces. It
+ creates a table using text format, with <code class="ph codeph">CHAR</code> values much shorter than the declared length,
+ and then prints the resulting data file to show that the delimited values are not separated by spaces. The
+ same behavior applies to binary-format Parquet data files.
+ </p>
+
+<pre class="pre codeblock"><code>create table char_in_text (a char(20), b char(30), c char(40))
+ row format delimited fields terminated by ',';
+
+insert into char_in_text values (cast('foo' as char(20)), cast('bar' as char(30)), cast('baz' as char(40))), (cast('hello' as char(20)), cast('goodbye' as char(30)), cast('aloha' as char(40)));
+
+-- Running this Linux command inside impala-shell using the ! shortcut.
+!hdfs dfs -cat 'hdfs://127.0.0.1:8020/user/hive/warehouse/impala_doc_testing.db/char_in_text/*.*';
+foo,bar,baz
+hello,goodbye,aloha
+</code></pre>
+
+ <p class="p">
+ The following example further illustrates the treatment of spaces. It replaces the contents of the previous
+ table with some values including leading spaces, trailing spaces, or both. Any leading spaces are preserved
+ within the data file, but trailing spaces are discarded. Then when the values are retrieved by a query, the
+ leading spaces are retrieved verbatim while any necessary trailing spaces are supplied by Impala.
+ </p>
+
+<pre class="pre codeblock"><code>insert overwrite char_in_text values (cast('trailing ' as char(20)), cast(' leading and trailing ' as char(30)), cast(' leading' as char(40)));
+!hdfs dfs -cat 'hdfs://127.0.0.1:8020/user/hive/warehouse/impala_doc_testing.db/char_in_text/*.*';
+trailing, leading and trailing, leading
+
+select concat('[',a,']') as a, concat('[',b,']') as b, concat('[',c,']') as c from char_in_text;
++------------------------+----------------------------------+--------------------------------------------+
+| a | b | c |
++------------------------+----------------------------------+--------------------------------------------+
+| [trailing ] | [ leading and trailing ] | [ leading ] |
++------------------------+----------------------------------+--------------------------------------------+
+</code></pre>
+
+ <p class="p">
+ <strong class="ph b">Kudu considerations:</strong>
+ </p>
+ <p class="p">
+ Currently, the data types <code class="ph codeph">CHAR</code>, <code class="ph codeph">VARCHAR</code>,
+ <code class="ph codeph">ARRAY</code>, <code class="ph codeph">MAP</code>, and <code class="ph codeph">STRUCT</code> cannot be used with Kudu tables.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Restrictions:</strong>
+ </p>
+
+ <p class="p">
+ Because the blank-padding behavior requires allocating the maximum length for each value in memory, for
+ scalability reasons avoid declaring <code class="ph codeph">CHAR</code> columns that are much longer than typical values in
+ that column.
+ </p>
+
+ <p class="p">
+ All data in <code class="ph codeph">CHAR</code> and <code class="ph codeph">VARCHAR</code> columns must be in a character encoding that
+ is compatible with UTF-8. If you have binary data from another database system (that is, a BLOB type), use
+ a <code class="ph codeph">STRING</code> column to hold it.
+ </p>
+
+ <p class="p">
+ When an expression compares a <code class="ph codeph">CHAR</code> with a <code class="ph codeph">STRING</code> or
+ <code class="ph codeph">VARCHAR</code>, the <code class="ph codeph">CHAR</code> value is implicitly converted to <code class="ph codeph">STRING</code>
+ first, with trailing spaces preserved.
+ </p>
+
+<pre class="pre codeblock"><code>select cast("foo " as char(5)) = 'foo' as "char equal to string";
++----------------------+
+| char equal to string |
++----------------------+
+| false |
++----------------------+
+</code></pre>
+
+ <p class="p">
+ This behavior differs from other popular database systems. To get the expected result of
+ <code class="ph codeph">TRUE</code>, cast the expressions on both sides to <code class="ph codeph">CHAR</code> values of the appropriate
+ length:
+ </p>
+
+<pre class="pre codeblock"><code>select cast("foo " as char(5)) = cast('foo' as char(3)) as "char equal to string";
++----------------------+
+| char equal to string |
++----------------------+
+| true |
++----------------------+
+</code></pre>
+
+ <p class="p">
+ This behavior is subject to change in future releases.
+ </p>
+
+ <p class="p">
+ <strong class="ph b">Related information:</strong>
+ </p>
+
+ <p class="p">
+ <a class="xref" href="impala_string.html#string">STRING Data Type</a>, <a class="xref" href="impala_varchar.html#varchar">VARCHAR Data Type (Impala 2.0 or higher only)</a>,
+ <a class="xref" href="impala_literals.html#string_literals">String Literals</a>,
+ <a class="xref" href="impala_string_functions.html#string_functions">Impala String Functions</a>
+ </p>
+ </div>
+<nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_datatypes.html">Data Types</a></div></div></nav></article></main></body></html>
http://git-wip-us.apache.org/repos/asf/impala/blob/fae51ec2/docs/build3x/html/topics/impala_comments.html
----------------------------------------------------------------------
diff --git a/docs/build3x/html/topics/impala_comments.html b/docs/build3x/html/topics/impala_comments.html
new file mode 100644
index 0000000..62bd6ee
--- /dev/null
+++ b/docs/build3x/html/topics/impala_comments.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html
+ SYSTEM "about:legacy-compat">
+<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2018"><meta name="DC.rights.owner" content="(C) Copyright 2018"><meta name="DC.Type" content="concept"><meta name="DC.Relation" scheme="URI" content="../topics/impala_langref.html"><meta name="prodname" content="Impala"><meta name="prodname" content="Impala"><meta name="version" content="Impala 3.0.x"><meta name="version" content="Impala 3.0.x"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="comments"><link rel="stylesheet" type="text/css" href="../commonltr.css"><title>Comments</title></head><body id="comments"><main role="main"><article role="article" aria-labelledby="ariaid-title1">
+
+ <h1 class="title topictitle1" id="ariaid-title1">Comments</h1>
+
+
+ <div class="body conbody">
+
+ <p class="p">
+
+ Impala supports the familiar styles of SQL comments:
+ </p>
+
+ <ul class="ul">
+ <li class="li">
+ All text from a <code class="ph codeph">--</code> sequence to the end of the line is considered a comment and ignored.
+ This type of comment can occur on a single line by itself, or after all or part of a statement.
+ </li>
+
+ <li class="li">
+ All text from a <code class="ph codeph">/*</code> sequence to the next <code class="ph codeph">*/</code> sequence is considered a
+ comment and ignored. This type of comment can stretch over multiple lines. This type of comment can occur
+ on one or more lines by itself, in the middle of a statement, or before or after a statement.
+ </li>
+ </ul>
+
+ <p class="p">
+ For example:
+ </p>
+
+<pre class="pre codeblock"><code>-- This line is a comment about a table.
+create table ...;
+
+/*
+This is a multi-line comment about a query.
+*/
+select ...;
+
+select * from t /* This is an embedded comment about a query. */ where ...;
+
+select * from t -- This is a trailing comment within a multi-line command.
+where ...;
+</code></pre>
+ </div>
+<nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_langref.html">Impala SQL Language Reference</a></div></div></nav></article></main></body></html>