mirror of
https://github.com/apache/impala.git
synced 2026-01-01 18:00:30 -05:00
Upgrade with details of latest syntax. Fine-tune discussion of PK and other Kudu notions. The impala_kudu diff looks larger than actual changes to the page, because subtopics got moved around and promoted/demoted (which changes the indentation). Best to review that page start-to-finish. CREATE TABLE details for Impala + Kudu. ALTER TABLE details for Impala + Kudu. Unhide the Impala partitioning + Kudu topic. Mainly a brief intro then a link to delegate details to the main Kudu page, which already has a partitioning subtopic. Include changes to reserved words. Entirely from Kudu integration work. Add Kudu considerations for misc SQL statements. Addressed Todd's and Dimitris's comments for certain files. (Up to the beginning of the "Partitioning" section in impala_kudu.xml.) Added Kudu blurbs to data type topics: - Some aren't supported. - Others are supported but can't go in the primary key. Added walkthrough of renaming internal/external tables. Split out Kudu CREATE TABLE syntax from other file formats. Correct info about CTAS for Kudu tables. Add examples of basic Kudu, external Kudu, and Kudu CTAS. Change-Id: I76dcb948dab08532fe41326b22ef78d73282db2c Reviewed-on: http://gerrit.cloudera.org:8080/5649 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: Impala Public Jenkins
116 lines
4.3 KiB
XML
116 lines
4.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
|
|
<concept id="float">
|
|
|
|
<title>FLOAT Data Type</title>
|
|
<titlealts audience="PDF"><navtitle>FLOAT</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 single precision floating-point 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> FLOAT</codeblock>
|
|
|
|
<p>
|
|
<b>Range:</b> 1.40129846432481707e-45 .. 3.40282346638528860e+38, positive or negative
|
|
</p>
|
|
|
|
<p>
|
|
<b>Precision:</b> 6 to 9 significant digits, depending on usage. The number of significant digits does
|
|
not depend on the position of the decimal point.
|
|
</p>
|
|
|
|
<p>
|
|
<b>Representation:</b> The values are stored in 4 bytes, using
|
|
<xref href="https://en.wikipedia.org/wiki/Single-precision_floating-point_format" scope="external" format="html">IEEE 754 Single Precision Binary Floating Point</xref> format.
|
|
</p>
|
|
|
|
<p>
|
|
<b>Conversions:</b> Impala automatically converts <codeph>FLOAT</codeph> to more precise
|
|
<codeph>DOUBLE</codeph> values, but not the other way around. You can use <codeph>CAST()</codeph> to convert
|
|
<codeph>FLOAT</codeph> values to <codeph>TINYINT</codeph>, <codeph>SMALLINT</codeph>, <codeph>INT</codeph>,
|
|
<codeph>BIGINT</codeph>, <codeph>STRING</codeph>, <codeph>TIMESTAMP</codeph>, or <codeph>BOOLEAN</codeph>.
|
|
You can use exponential notation in <codeph>FLOAT</codeph> literals or when casting from
|
|
<codeph>STRING</codeph>, for example <codeph>1.0e6</codeph> to represent one million.
|
|
<ph conref="../shared/impala_common.xml#common/cast_int_to_timestamp"/>
|
|
</p>
|
|
|
|
<p conref="../shared/impala_common.xml#common/example_blurb"/>
|
|
|
|
<codeblock>CREATE TABLE t1 (x FLOAT);
|
|
SELECT CAST(1000.5 AS FLOAT);
|
|
</codeblock>
|
|
|
|
<p conref="../shared/impala_common.xml#common/partitioning_imprecise"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/hbase_ok"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/parquet_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_4_bytes"/>
|
|
|
|
<!-- <p conref="../shared/impala_common.xml#common/added_in_20"/> -->
|
|
|
|
<p conref="../shared/impala_common.xml#common/column_stats_constant"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/restrictions_blurb"/>
|
|
|
|
<!-- This conref appears under SUM(), AVG(), FLOAT, and DOUBLE topics. -->
|
|
|
|
<p conref="../shared/impala_common.xml#common/sum_double"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/float_double_decimal_caveat"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/kudu_blurb"/>
|
|
<p conref="../shared/impala_common.xml#common/kudu_non_pk_data_type"/>
|
|
|
|
<p conref="../shared/impala_common.xml#common/related_info"/>
|
|
|
|
<p>
|
|
<xref href="impala_literals.xml#numeric_literals"/>, <xref href="impala_math_functions.xml#math_functions"/>,
|
|
<xref href="impala_double.xml#double"/>
|
|
</p>
|
|
</conbody>
|
|
</concept>
|