blob: 04ac5cbf48c378a5d14118b6ef827504bdf21bf3 [file] [log] [blame]
<?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="langref">
<title>Impala SQL Language Reference</title>
<titlealts audience="PDF"><navtitle>SQL Reference</navtitle></titlealts>
<prolog>
<metadata>
<data name="Category" value="Impala"/>
<data name="Category" value="SQL"/>
<data name="Category" value="Data Analysts"/>
<data name="Category" value="Developers"/>
<data name="Category" value="impala-shell"/>
</metadata>
</prolog>
<conbody>
<p>
Impala uses SQL as its query language. To protect user investment in skills development and query
design, Impala provides a high degree of compatibility with the Hive Query Language (HiveQL):
</p>
<ul>
<li>
Because Impala uses the same metadata store as Hive to record information about table structure and
properties, Impala can access tables defined through the native Impala <codeph>CREATE TABLE</codeph>
command, or tables created using the Hive data definition language (DDL).
</li>
<li>
Impala supports data manipulation (DML) statements similar to the DML component of HiveQL.
</li>
<li>
Impala provides many <xref href="impala_functions.xml#builtins">built-in functions</xref> with the same
names and parameter types as their HiveQL equivalents.
</li>
</ul>
<p>
Impala supports most of the same <xref href="impala_langref_sql.xml#langref_sql">statements and
clauses</xref> as HiveQL, including, but not limited to <codeph>JOIN</codeph>, <codeph>AGGREGATE</codeph>,
<codeph>DISTINCT</codeph>, <codeph>UNION ALL</codeph>, <codeph>ORDER BY</codeph>, <codeph>LIMIT</codeph> and
(uncorrelated) subquery in the <codeph>FROM</codeph> clause. Impala also supports <codeph>INSERT
INTO</codeph> and <codeph>INSERT OVERWRITE</codeph>.
</p>
<p>
Impala supports data types with the same names and semantics as the equivalent Hive data types:
<codeph>STRING</codeph>, <codeph>TINYINT</codeph>, <codeph>SMALLINT</codeph>, <codeph>INT</codeph>,
<codeph>BIGINT</codeph>, <codeph>FLOAT</codeph>, <codeph>DOUBLE</codeph>, <codeph>BOOLEAN</codeph>,
<codeph>STRING</codeph>, <codeph>TIMESTAMP</codeph>.
</p>
<p>
For full details about Impala SQL syntax and semantics, see
<xref href="impala_langref_sql.xml#langref_sql"/>.
</p>
<p>
Most HiveQL <codeph>SELECT</codeph> and <codeph>INSERT</codeph> statements run unmodified with Impala. For
information about Hive syntax not available in Impala, see
<xref href="impala_langref_unsupported.xml#langref_hiveql_delta"/>.
</p>
<p>
For a list of the built-in functions available in Impala queries, see
<xref href="impala_functions.xml#builtins"/>.
</p>
<p outputclass="toc"/>
</conbody>
</concept>