mirror of
https://github.com/apache/impala.git
synced 2026-01-10 00:00:16 -05:00
These are refugees from doc_prototype. They can be rendered with the DITA Open Toolkit version 2.3.3 by: /tmp/dita-ot-2.3.3/bin/dita \ -i impala.ditamap \ -f html5 \ -o $(mktemp -d) \ -filter impala_html.ditaval Change-Id: I8861e99adc446f659a04463ca78c79200669484f Reviewed-on: http://gerrit.cloudera.org:8080/5014 Reviewed-by: John Russell <jrussell@cloudera.com> Tested-by: John Russell <jrussell@cloudera.com>
104 lines
3.8 KiB
XML
104 lines
3.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
|
|
<concept id="tinyint">
|
|
|
|
<title>TINYINT Data Type</title>
|
|
<titlealts audience="PDF"><navtitle>TINYINT</navtitle></titlealts>
|
|
<prolog>
|
|
<metadata>
|
|
<data name="Category" value="Impala"/>
|
|
<data name="Category" value="Impala Data Types"/>
|
|
<data name="Category" value="SQL"/>
|
|
<data name="Category" value="Data Analysts"/>
|
|
<data name="Category" value="Developers"/>
|
|
<data name="Category" value="Schemas"/>
|
|
</metadata>
|
|
</prolog>
|
|
|
|
<conbody>
|
|
|
|
<p>
|
|
A 1-byte integer data type used in <codeph>CREATE TABLE</codeph> and <codeph>ALTER TABLE</codeph> statements.
|
|
</p>
|
|
|
|
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
|
|
|
|
<p>
|
|
In the column definition of a <codeph>CREATE TABLE</codeph> statement:
|
|
</p>
|
|
|
|
<codeblock><varname>column_name</varname> TINYINT</codeblock>
|
|
|
|
<p>
|
|
<b>Range:</b> -128 .. 127. There is no <codeph>UNSIGNED</codeph> subtype.
|
|
</p>
|
|
|
|
<p>
|
|
<b>Conversions:</b> Impala automatically converts to a larger integer type (<codeph>SMALLINT</codeph>,
|
|
<codeph>INT</codeph>, or <codeph>BIGINT</codeph>) or a floating-point type (<codeph>FLOAT</codeph> or
|
|
<codeph>DOUBLE</codeph>) automatically. Use <codeph>CAST()</codeph> to convert to <codeph>STRING</codeph> or
|
|
<codeph>TIMESTAMP</codeph>.
|
|
<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>
|
|
For a convenient and automated way to check the bounds of the <codeph>TINYINT</codeph> type, call the
|
|
functions <codeph>MIN_TINYINT()</codeph> and <codeph>MAX_TINYINT()</codeph>.
|
|
</p>
|
|
|
|
<p>
|
|
If an integer value is too large to be represented as a <codeph>TINYINT</codeph>, use a
|
|
<codeph>SMALLINT</codeph> instead.
|
|
</p>
|
|
|
|
<p conref="../shared/impala_common.xml#common/null_bad_numeric_cast"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/example_blurb"/>
|
|
|
|
<codeblock>CREATE TABLE t1 (x TINYINT);
|
|
SELECT CAST(100 AS TINYINT);
|
|
</codeblock>
|
|
|
|
<p conref="../shared/impala_common.xml#common/parquet_blurb"/>
|
|
|
|
<!-- Duplicated under TINYINT and SMALLINT. Turn into a conref in both places. -->
|
|
|
|
<p rev="1.4.0">
|
|
Physically, Parquet files represent <codeph>TINYINT</codeph> and <codeph>SMALLINT</codeph> values as 32-bit
|
|
integers. Although Impala rejects attempts to insert out-of-range values into such columns, if you create a
|
|
new table with the <codeph>CREATE TABLE ... LIKE PARQUET</codeph> syntax, any <codeph>TINYINT</codeph> or
|
|
<codeph>SMALLINT</codeph> columns in the original table turn into <codeph>INT</codeph> columns in the new
|
|
table.
|
|
</p>
|
|
|
|
<!-- <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="../shared/impala_common.xml#common/compatibility_blurb"/> -->
|
|
|
|
<p conref="../shared/impala_common.xml#common/internals_1_bytes"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/added_forever"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/column_stats_constant"/>
|
|
|
|
<!-- <p conref="../shared/impala_common.xml#common/restrictions_blurb"/> -->
|
|
|
|
<p conref="../shared/impala_common.xml#common/related_info"/>
|
|
|
|
<p>
|
|
<xref href="impala_literals.xml#numeric_literals"/>, <xref href="impala_tinyint.xml#tinyint"/>,
|
|
<xref href="impala_smallint.xml#smallint"/>, <xref href="impala_int.xml#int"/>,
|
|
<xref href="impala_bigint.xml#bigint"/>, <xref href="impala_decimal.xml#decimal"/>,
|
|
<xref href="impala_math_functions.xml#math_functions"/>
|
|
</p>
|
|
</conbody>
|
|
</concept>
|