http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/3c2c8f12/docs/topics/impala_tinyint.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_tinyint.xml b/docs/topics/impala_tinyint.xml index 2b1b3a8..2756cb8 100644 --- a/docs/topics/impala_tinyint.xml +++ b/docs/topics/impala_tinyint.xml @@ -3,7 +3,7 @@ <concept id="tinyint"> <title>TINYINT Data Type</title> - <titlealts><navtitle>TINYINT</navtitle></titlealts> + <titlealts audience="PDF"><navtitle>TINYINT</navtitle></titlealts> <prolog> <metadata> <data name="Category" value="Impala"/> @@ -41,6 +41,8 @@ <ph conref="../shared/impala_common.xml#common/cast_int_to_timestamp"/> </p> + <p conref="../shared/impala_common.xml#common/int_overflow_behavior"/> + <p conref="../shared/impala_common.xml#common/usage_notes_blurb"/> <p> @@ -73,13 +75,13 @@ SELECT CAST(100 AS TINYINT); table. </p> -<!-- <p conref="/Content/impala_common_xi44078.xml#common/partitioning_blurb"/> --> +<!-- <p conref="../shared/impala_common.xml#common/partitioning_blurb"/> --> <p conref="../shared/impala_common.xml#common/hbase_ok"/> <p conref="../shared/impala_common.xml#common/text_bulky"/> -<!-- <p conref="/Content/impala_common_xi44078.xml#common/compatibility_blurb"/> --> +<!-- <p conref="../shared/impala_common.xml#common/compatibility_blurb"/> --> <p conref="../shared/impala_common.xml#common/internals_1_bytes"/> @@ -87,7 +89,7 @@ SELECT CAST(100 AS TINYINT); <p conref="../shared/impala_common.xml#common/column_stats_constant"/> -<!-- <p conref="/Content/impala_common_xi44078.xml#common/restrictions_blurb"/> --> +<!-- <p conref="../shared/impala_common.xml#common/restrictions_blurb"/> --> <p conref="../shared/impala_common.xml#common/related_info"/>
http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/3c2c8f12/docs/topics/impala_truncate_table.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_truncate_table.xml b/docs/topics/impala_truncate_table.xml index 9f0d00b..220354b 100644 --- a/docs/topics/impala_truncate_table.xml +++ b/docs/topics/impala_truncate_table.xml @@ -1,26 +1,31 @@ <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> -<concept rev="2.3.0 5.5.0" id="truncate_table"> +<concept rev="2.3.0" id="truncate_table"> <title>TRUNCATE TABLE Statement (CDH 5.5 or higher only)</title> - <titlealts><navtitle>TRUNCATE TABLE</navtitle></titlealts> + <titlealts audience="PDF"><navtitle>TRUNCATE TABLE</navtitle></titlealts> <prolog> <metadata> <data name="Category" value="Impala"/> <data name="Category" value="SQL"/> + <data name="Category" value="DDL"/> + <data name="Category" value="S3"/> + <data name="Category" value="Tables"/> + <data name="Category" value="Disk Storage"/> + <data name="Category" value="Developers"/> + <data name="Category" value="Data Analysts"/> </metadata> </prolog> <conbody> - <p> + <p rev="2.3.0"> <indexterm audience="Cloudera">TRUNCATE TABLE statement</indexterm> Removes the data from an Impala table while leaving the table itself. </p> <p conref="../shared/impala_common.xml#common/syntax_blurb"/> -<!-- <codeblock>TRUNCATE TABLE [IF EXISTS] [<varname>db_name</varname>.]<varname>table_name</varname></codeblock> --> -<codeblock>TRUNCATE TABLE [<varname>db_name</varname>.]<varname>table_name</varname></codeblock> +<codeblock>TRUNCATE TABLE <ph rev="2.5.0 IMPALA-2641">[IF EXISTS]</ph> [<varname>db_name</varname>.]<varname>table_name</varname></codeblock> <p conref="../shared/impala_common.xml#common/ddl_blurb"/> @@ -49,13 +54,12 @@ <codeph><varname>db_name</varname>.<varname>table_name</varname></codeph>. </p> -<!-- IF EXISTS apparently not implemented for this first go-round. Filing a JIRA about that: - <p> + <p rev="2.5.0 IMPALA-2641"> The optional <codeph>IF EXISTS</codeph> clause makes the statement succeed whether or not the table exists. If the table does exist, it is truncated; if it does not exist, the statement has no effect. This capability is useful in standardized setup scripts that are might be run both before and after some of the tables exist. + This clause is available in CDH 5.7 / Impala 2.5 and higher. </p> ---> <p> Any HDFS data files removed by this statement go into the HDFS trashcan, from which you can recover them @@ -138,6 +142,35 @@ SHOW COLUMN STATS truncate_demo; +--------+------+------------------+--------+----------+----------+ </codeblock> + <p> + The following example shows how the <codeph>IF EXISTS</codeph> clause allows the <codeph>TRUNCATE TABLE</codeph> + statement to be run without error whether or not the table exists: + </p> + +<codeblock rev="2.5.0 IMPALA-2641">CREATE TABLE staging_table1 (x INT, s STRING); +Fetched 0 row(s) in 0.33s + +SHOW TABLES LIKE 'staging*'; ++----------------+ +| name | ++----------------+ +| staging_table1 | ++----------------+ +Fetched 1 row(s) in 0.25s + +-- Our ETL process involves removing all data from several staging tables +-- even though some might be already dropped, or not created yet. + +TRUNCATE TABLE IF EXISTS staging_table1; +Fetched 0 row(s) in 5.04s + +TRUNCATE TABLE IF EXISTS staging_table2; +Fetched 0 row(s) in 0.25s + +TRUNCATE TABLE IF EXISTS staging_table3; +Fetched 0 row(s) in 0.25s +</codeblock> + <p conref="../shared/impala_common.xml#common/related_info"/> <p>
