Language Manual
Apache Hive : Write Ordering
Oct 31, 2025Apache Hive : Write Ordering
Overview
Write ordering controls the physical layout of data within table files. Unlike SORT BY which orders data during query execution, write ordering is applied at write time and persists in the stored files.
Write ordering is supported for Iceberg tables and can be specified during table creation.
Hive supports two write ordering strategies:
- Type-Native Ordering: Sort by one or more columns in a specified order
- Z-Ordering: Multi-dimensional clustering using space-filling curves
Type-Native Column Ordering
Version
Introduced in Hive version 4.1.0
Apache Hive : Apache Hive SQL Conformance
Dec 12, 2024Apache Hive : Apache Hive SQL Conformance
This page documents which parts of the SQL standard are supported by Apache Hive. The information here is not a full statement of conformance but provides users detail sufficient to generally understand Hive’s SQL conformance.
This information is versioned by Hive release version, allowing a user to quickly identify features available to them.
The formal name of the current SQL standard is ISO/IEC 9075 “Database Language SQL”. A revised version of the standard is released from time to time; the most recent update appearing in 2016. The 2016 version is referred to as ISO/IEC 9075:2016, or simply as SQL:2016. Hive’s SQL Conformance pages reference SQL features by the Feature ID values of the SQL:2016 Standard.
Apache Hive : CAST…FORMAT with SQL:2016 datetime formats
Usage
CAST(<timestamp/date> AS <varchar/char/string> [FORMAT <template>])
CAST(<varchar/char/string> AS <timestamp/date> [FORMAT <template>])
Example
select cast(dt as string format 'DD-MM-YYYY')
select cast('01-05-2017' as date format 'DD-MM-YYYY')
Template elements, a.k.a. Tokens, a.k.a Patterns a.k.a SQL:2016 Datetime Formats
Notes
For all tokens:
- Patterns are case-insensitive, except AM/PM and T/Z. See these sections for more details.
- For string to datetime conversion, no duplicate format tokens are allowed, including tokens
that have the same meaning but different lengths (“Y” and “YY” conflict) or different
behaviors (“RR” and “YY” conflict).
For all numeric tokens:
Apache Hive : Common Table Expression
Dec 12, 2024Apache Hive : Common Table Expression
A Common Table Expression (CTE) is a temporary result set derived from a simple query specified in a WITH clause, which immediately precedes a SELECT or INSERT keyword. The CTE is defined only within the execution scope of a single statement. One or more CTEs can be used in a Hive SELECT, INSERT, CREATE TABLE AS SELECT, or CREATE VIEW AS SELECT statement.
Version
Common Table Expressions are added in Hive 0.13.0 with HIVE-1180.
Apache Hive : Compaction pooling
Dec 12, 2024Apache Hive : Compaction pooling
Concept:
Compaction requests and workers can be assigned to pools. A worker assigned to a specific pool will only process compaction requests in that pool. Workers and compaction requests without pool assignment are implicitly belong to the default pool. The pooling concept allows fine tuning of processing compaction requests. For example it is possible to create a pool name ‘high priority compaction’, assign some frequently modified tables to it, and dedicate a set of workers to this pool. As a result, the compaction requests for these tables will be immediately picked up by the dedicated workers, even if there are several other compaction requests (enqueued earlier) in the default queue.
Apache Hive : Datasketches Integration
Dec 12, 2024Apache Hive : Datasketches Integration
Apache DataSketches (https://datasketches.apache.org/) is integrated into Hive via HIVE-22939.
This enables various kind of sketch operations thru regular sql statement.
Sketch functions
Naming convention
All sketch functions are registered using the following naming convention:
ds_{sketchType}_{functionName}
For example we have a function called: ds_hll_estimate which could be used to estimate the distinct values from an hll sketch.
sketchType
For detailed info about the sketches themself please refer to the datasketches site!
Apache Hive : Enhanced Aggregation, Cube, Grouping and Rollup
This document describes enhanced aggregation features for the GROUP BY clause of SELECT statements.
Version
Grouping sets, CUBE and ROLLUP operators, and the GROUPING__ID function were added in Hive 0.10.0.
See HIVE-2397, HIVE-3433, HIVE-3471, and HIVE-3613.
Also see HIVE-3552 for an improvement added in Hive 0.11.0.
Version
GROUPING__ID is compliant with semantics in other SQL engines starting in Hive 2.3.0 (see HIVE-16102).
Support for SQL grouping function was added in Hive 2.3.0 too (see HIVE-15409).
Apache Hive : Exchange Partition
Dec 12, 2024Apache Hive : Exchange Partition
The EXCHANGE PARTITION command will move a partition from a source table to target table and alter each table’s metadata. The Exchange Partition feature is implemented as part of HIVE-4095. Exchanging multiple partitions is supported in Hive versions 1.2.2, 1.3.0, and 2.0.0+ as part of HIVE-11745.
When the command is executed, the source table’s partition folder in HDFS will be renamed to move it to the destination table’s partition folder. The Hive metastore will be updated to change the metadata of the source and destination tables accordingly.
Apache Hive : GenericUDAFCaseStudy
Dec 12, 2024Apache Hive : Tutorial to write a GenericUDAF
User-Defined Aggregation Functions (UDAFs) are an excellent way to integrate advanced data-processing into Hive. Hive allows two varieties of UDAFs: simple and generic. Simple UDAFs, as the name implies, are rather simple to write, but incur performance penalties because of the use of Java Reflection, and do not allow features such as variable-length argument lists. Generic UDAFs allow all these features, but are perhaps not quite as intuitive to write as Simple UDAFs.
Apache Hive : Hive Operators
Dec 12, 2024Apache Hive : Hive Operators
Operators Precedences
| Example | Operators | Description |
|---|---|---|
| A[B] , A.identifier | bracket_op([]), dot(.) | element selector, dot |
| -A | unary(+), unary(-), unary(~) | unary prefix operators |
| A IS [NOT] (NULL | TRUE | FALSE) |
| A ^ B | bitwise xor(^) | bitwise xor |
| A * B | star(*), divide(/), mod(%), div(DIV) | multiplicative operators |
| A + B | plus(+), minus(-) | additive operators |
| A | B | |
| A & B | bitwise and(&) | bitwise and |
| A | B | bitwise or( |
Relational Operators
The following operators compare the passed operands and generate a TRUE or FALSE value depending on whether the comparison between the operands holds.
Apache Hive : Hive UDFs
Dec 12, 2024Apache Hive : Hive UDFs
Hive User-Defined Functions (UDFs) are custom functions developed in Java and seamlessly integrated with Apache Hive. UDFs are routines designed to accept parameters, execute a specific action, and return the resulting value. The return value can either be a single scalar row or a complete result set, depending on the UDF’s code and the implemented interface. UDFs represent a powerful capability that enhances classical SQL functionality by allowing the integration of custom code, providing Hive users with a versatile toolset. Apache Hive comes equipped with a variety of built-in UDFs that users can leverage. Similar to other SQL-based solutions, Hive also offers functionality to expand its already rich set of UDFs by incorporating custom ones as needed.
Apache Hive : HivePlugins
Dec 12, 2024Apache Hive : Plugins
Creating Custom UDFs
First, you need to create a new class that extends UDF, with one or more methods named evaluate.
package com.example.hive.udf;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
public final class Lower extends UDF {
public Text evaluate(final Text s) {
if (s == null) { return null; }
return new Text(s.toString().toLowerCase());
}
}
(Note that there’s already a built-in function for this, it’s just an easy example).
Apache Hive : HiveQL
Dec 12, 2024Apache Hive : LanguageManual
Dec 12, 2024Apache Hive : LanguageManual
This is the Hive Language Manual. For other Hive documentation, see the Hive wiki’s Home page.
Commands and CLIs
File Formats
Data Definition Statements
Data Manipulation Statements
Data Retrieval: Queries
Apache Hive : LanguageManual Archiving
Dec 12, 2024Apache Hive : LanguageManual Archiving
Archiving for File Count Reduction.
Overview
Due to the design of HDFS, the number of files in the filesystem directly affects the memory consumption in the namenode. While normally not a problem for small clusters, memory usage may hit the limits of accessible memory on a single machine when there are >50-100 million files. In such situations, it is advantageous to have as few files as possible.
Apache Hive : LanguageManual Authorization
Dec 12, 2024Apache Hive : LanguageManual Authorization
Introduction
Note that this documentation is referring to Authorization which is verifying if a user has permission to perform a certain action, and not about Authentication (verifying the identity of the user). Strong authentication for tools like the Hive command line is provided through the use of Kerberos. There are additional authentication options for users of HiveServer2.
Hive Authorization Options
Three modes of Hive authorization are available to satisfy different use cases.
Apache Hive : LanguageManual Cli
Dec 12, 2024Apache Hive : LanguageManual Hive CLI
$HIVE_HOME/bin/hive is a shell utility which can be used to run Hive queries in either interactive or batch mode.
Deprecation in favor of Beeline CLI
HiveServer2 (introduced in Hive 0.11) has its own CLI called Beeline, which is a JDBC client based on SQLLine. Due to new development being focused on HiveServer2, Hive CLI will soon be deprecated in favor of Beeline (HIVE-10511).
See Replacing the Implementation of Hive CLI Using Beeline and Beeline – New Command Line Shell in the HiveServer2 documentation.
Apache Hive : LanguageManual Commands
Dec 12, 2024Apache Hive : LanguageManual Commands
Commands are non-SQL statements such as setting a property or adding a resource. They can be used in HiveQL scripts or directly in the CLI or Beeline.
| Command | Description |
|---|---|
| quit exit | Use quit or exit to leave the interactive shell. |
| reset | Resets the configuration to the default values (as of Hive 0.10: see HIVE-3202). Any configuration parameters that were set using the set command or -hiveconf parameter in hive commandline will get reset to default value.Note that this does not apply to configuration parameters that were set in set command using the “hiveconf:” prefix for the key name (for historic reasons). |
| set = | Sets the value of a particular configuration variable (key). Note: If you misspell the variable name, the CLI will not show an error. |
| set | Prints a list of configuration variables that are overridden by the user or Hive. |
| set -v | Prints all Hadoop and Hive configuration variables. |
| add FILE[S] * add JAR[S] * add ARCHIVE[S] * | Adds one or more files, jars, or archives to the list of resources in the distributed cache. See Hive Resources for more information. |
| add FILE[S] * add JAR[S] * add ARCHIVE[S] * | As of Hive 1.2.0, adds one or more files, jars or archives to the list of resources in the distributed cache using an Ivy URL of the form ivy://group:module:version?query_string. See Hive Resources for more information. |
| list FILE[S] list JAR[S] list ARCHIVE[S] | Lists the resources already added to the distributed cache. See Hive Resources for more information. |
| list FILE[S] * list JAR[S] * list ARCHIVE[S] * | Checks whether the given resources are already added to the distributed cache or not. See Hive Resources for more information. |
| delete FILE[S] * delete JAR[S] * delete ARCHIVE[S] * | Removes the resource(s) from the distributed cache. |
| delete FILE[S] * delete JAR[S] * delete ARCHIVE[S] * | As of Hive 1.2.0, removes the resource(s) which were added using the from the distributed cache. See Hive Resources for more information. |
| ! | Executes a shell command from the Hive shell. |
| dfs | Executes a dfs command from the Hive shell. |
| Executes a Hive query and prints results to standard output. | |
| source FILE | Executes a script file inside the CLI. |
compile <groovy string> AS GROOVY NAMED | This allows inline Groovy code to be compiled and be used as a UDF (as of Hive 0.13.0). For a usage example, see Nov. 2013 Hive Contributors Meetup Presentations – Using Dynamic Compilation with Hive. |
| show processlist | Displays information about the operations currently running on HiveServer2. It helps to troubleshoot issues such as long running queries, connection starvation, etc. The command was introduced in HIVE-27829. |
Sample Usage:
Apache Hive : LanguageManual DDL
Dec 12, 2024Apache Hive : LanguageManual DDL
Overview
HiveQL DDL statements are documented here, including:
- CREATE DATABASE/SCHEMA, TABLE, VIEW, FUNCTION, INDEX
- DROP DATABASE/SCHEMA, TABLE, VIEW, INDEX
- TRUNCATE TABLE
- ALTER DATABASE/SCHEMA, TABLE, VIEW
- MSCK REPAIR TABLE (or ALTER TABLE RECOVER PARTITIONS)
- SHOW DATABASES/SCHEMAS, TABLES, TBLPROPERTIES, VIEWS, PARTITIONS, FUNCTIONS, INDEX[ES], COLUMNS, CREATE TABLE
- DESCRIBE DATABASE/SCHEMA, table_name, view_name, materialized_view_name
PARTITION statements are usually options of TABLE statements, except for SHOW PARTITIONS.
Keywords, Non-reserved Keywords and Reserved Keywords
| All Keywords | |
|---|---|
| Version | Non-reserved Keywords |
| Hive 1.2.0 | ADD, ADMIN, AFTER, ANALYZE, ARCHIVE, ASC, BEFORE, BUCKET, BUCKETS, CASCADE, CHANGE, CLUSTER, CLUSTERED, CLUSTERSTATUS, COLLECTION, COLUMNS, COMMENT, COMPACT, COMPACTIONS, COMPUTE, CONCATENATE, CONTINUE, DATA, DATABASES, DATETIME, DAY, DBPROPERTIES, DEFERRED, DEFINED, DELIMITED, DEPENDENCY, DESC, DIRECTORIES, DIRECTORY, DISABLE, DISTRIBUTE, ENABLE, ESCAPED, EXCLUSIVE, EXPLAIN, EXPORT, FIELDS, FILE, FILEFORMAT, FIRST, FORMAT, FORMATTED, FUNCTIONS, HOLD_DDLTIME, HOUR, IDXPROPERTIES, IGNORE, INDEX, INDEXES, INPATH, INPUTDRIVER, INPUTFORMAT, ITEMS, JAR, KEYS, LIMIT, LINES, LOAD, LOCATION, LOCK, LOCKS, LOGICAL, LONG, MAPJOIN, MATERIALIZED, METADATA, MINUS, MINUTE, MONTH, MSCK, NOSCAN, NO_DROP, OFFLINE, OPTION, OUTPUTDRIVER, OUTPUTFORMAT, OVERWRITE, OWNER, PARTITIONED, PARTITIONS, PLUS, PRETTY, PRINCIPALS, PROTECTION, PURGE, READ, READONLY, REBUILD, RECORDREADER, RECORDWRITER, REGEXP, RELOAD, RENAME, REPAIR, REPLACE, REPLICATION, RESTRICT, REWRITE, RLIKE, ROLE, ROLES, SCHEMA, SCHEMAS, SECOND, SEMI, SERDE, SERDEPROPERTIES, SERVER, SETS, SHARED, SHOW, SHOW_DATABASE, SKEWED, SORT, SORTED, SSL, STATISTICS, STORED, STREAMTABLE, STRING, STRUCT, TABLES, TBLPROPERTIES, TEMPORARY, TERMINATED, TINYINT, TOUCH, TRANSACTIONS, UNARCHIVE, UNDO, UNIONTYPE, UNLOCK, UNSET, UNSIGNED, URI, USE, UTC, VIEW, WHILE, YEAR |
| Hive 2.0.0 | removed: HOLD_DDLTIME, IGNORE, NO_DROP, OFFLINE, PROTECTION, READONLY, REGEXP, RLIKEadded: AUTOCOMMIT, ISOLATION, LEVEL, OFFSET, SNAPSHOT, TRANSACTION, WORK, WRITE |
| Hive 2.1.0 | added: ABORT, KEY, LAST, NORELY, NOVALIDATE, NULLS, RELY, VALIDATE |
| Hive 2.2.0 | removed: MINUSadded: CACHE, DAYS, DAYOFWEEK, DUMP, HOURS, MATCHED, MERGE, MINUTES, MONTHS, QUARTER, REPL, SECONDS, STATUS, VIEWS, WEEK, WEEKS, YEARS |
| Hive 2.3.0 | removed: MERGEadded: DETAIL, EXPRESSION, OPERATOR, SUMMARY, VECTORIZATION, WAIT |
| Hive 3.0.0 | removed: PRETTYadded: ACTIVATE, ACTIVE, ALLOC_FRACTION, CHECK, DEFAULT, DO, ENFORCED, KILL, MANAGEMENT, MAPPING, MOVE, PATH, PLAN, PLANS, POOL, QUERY, QUERY_PARALLELISM, REOPTIMIZATION, RESOURCE, SCHEDULING_POLICY, UNMANAGED, WORKLOAD, ZONE |
| Hive 3.1.0 | N/A |
| Hive 4.0.0 | added: AST, AT, BRANCH, CBO, COST, CRON, DCPROPERTIES, DEBUG, DISABLED, DISTRIBUTED, ENABLED, EVERY, EXECUTE, EXECUTED, EXPIRE_SNAPSHOTS, IGNORE, JOINCOST, MANAGED, MANAGEDLOCATION, OPTIMIZE, REMOTE, RESPECT, RETAIN, RETENTION, SCHEDULED, SET_CURRENT_SNAPSHOT, SNAPSHOTS, SPEC, SYSTEM_TIME, SYSTEM_VERSION, TAG, TRANSACTIONAL, TRIM, TYPE, UNKNOWN, URL, WITHIN |
Version information
Apache Hive : LanguageManual DDL BucketedTables
Dec 12, 2024Apache Hive : LanguageManual DDL BucketedTables
This is a brief example on creating and populating bucketed tables. (For another example, see Bucketed Sorted Tables.)
Bucketed tables are fantastic in that they allow much more efficient sampling than do non-bucketed tables, and they may later allow for time saving operations such as mapside joins. However, the bucketing specified at table creation is not enforced when the table is written to, and so it is possible for the table’s metadata to advertise properties which are not upheld by the table’s actual layout. This should obviously be avoided. Here’s how to do it right.
Apache Hive : LanguageManual DML
Dec 12, 2024Apache Hive : LanguageManual DML
Hive Data Manipulation Language
Loading files into tables
Hive does not do any transformation while loading data into tables. Load operations are currently pure copy/move operations that move datafiles into locations corresponding to Hive tables.
Syntax
LOAD DATA [LOCAL] INPATH 'filepath' [OVERWRITE] INTO TABLE tablename [PARTITION (partcol1=val1, partcol2=val2 ...)]
LOAD DATA [LOCAL] INPATH 'filepath' [OVERWRITE] INTO TABLE tablename [PARTITION (partcol1=val1, partcol2=val2 ...)] [INPUTFORMAT 'inputformat' SERDE 'serde'] (3.0 or later)
Synopsis
Load operations prior to Hive 3.0 are pure copy/move operations that move datafiles into locations corresponding to Hive tables.
Apache Hive : LanguageManual Explain
Dec 12, 2024Apache Hive : LanguageManual Explain
EXPLAIN Syntax
Hive provides an EXPLAIN command that shows the execution plan for a query. The syntax for this statement is as follows:
EXPLAIN [EXTENDED|CBO|AST|DEPENDENCY|AUTHORIZATION|LOCKS|VECTORIZATION|ANALYZE] query
AUTHORIZATION is supported from HIVE 0.14.0 via HIVE-5961. VECTORIZATION is supported from Hive 2.3.0 via HIVE-11394. LOCKS is supported from Hive 3.2.0 via HIVE-17683.
AST was removed from EXPLAIN EXTENDED in HIVE-13533 and reinstated as a separate command in HIVE-15932.
The use of EXTENDED in the EXPLAIN statement produces extra information about the operators in the plan. This is typically physical information like file names.
Apache Hive : LanguageManual GroupBy
Dec 12, 2024Apache Hive : LanguageManual GroupBy
Group By Syntax
groupByClause: GROUP BY groupByExpression (, groupByExpression)*
groupByExpression: expression
groupByQuery: SELECT expression (, expression)* FROM src groupByClause?
In groupByExpression columns are specified by name, not by position number. However in Hive 0.11.0 and later, columns can be specified by position when configured as follows:
- For Hive 0.11.0 through 2.1.x, set hive.groupby.orderby.position.alias to true (the default is false).
- For Hive 2.2.0 and later, set hive.groupby.position.alias to true (the default is false).
Simple Examples
In order to count the number of rows in a table:
Apache Hive : LanguageManual ImportExport
Dec 12, 2024Apache Hive : LanguageManual Import/Export
Version information
The EXPORT and IMPORT commands were added in Hive 0.8.0 (see HIVE-1918).
Replication extensions to the EXPORT and IMPORT commands were added in Hive 1.2.0 (see HIVE-7973 and Hive Replication Development).
Overview
The EXPORT command exports the data of a table or partition, along with the metadata, into a specified output location. This output location can then be moved over to a different Hadoop or Hive instance and imported from there with the IMPORT command.
Apache Hive : LanguageManual Indexing
Dec 12, 2024Apache Hive : LanguageManual Indexing
Indexing Is Removed since 3.0
There are alternate options which might work similarily to indexing:
- Materialized views with automatic rewriting can result in very similar results. Hive 2.3.0 adds support for materialzed views.
- Using columnar file formats (Parquet, ORC) – they can do selective scanning; they may even skip entire files/blocks.
Indexing has been removed in version 3.0 (HIVE-18448).
Overview of Hive Indexes
The goal of Hive indexing is to improve the speed of query lookup on certain columns of a table. Without an index, queries with predicates like ‘WHERE tab1.col1 = 10’ load the entire table or partition and process all the rows. But if an index exists for col1, then only a portion of the file needs to be loaded and processed.
Apache Hive : LanguageManual JoinOptimization
Dec 12, 2024Apache Hive : LanguageManual Join Optimization
Improvements to the Hive Optimizer
Version
The join optimizations described here were added in Hive version 0.11.0. See HIVE-3784 and related JIRAs.
This document describes optimizations of Hive’s query execution planning to improve the efficiency of joins and reduce the need for user hints.
Hive automatically recognizes various use cases and optimizes for them. Hive 0.11 improves the optimizer for these cases:
- Joins where one side fits in memory. In the new optimization:
- that side is loaded into memory as a hash table
- only the larger table needs to be scanned
- fact tables have a smaller footprint in memory
- Star-schema joins
- Hints are no longer needed for many cases.
- Map joins are automatically picked up by the optimizer.
Star Join Optimization
A simple schema for decision support systems or data warehouses is the star schema, where events are collected in large fact tables, while smaller supporting tables (dimensions) are used to describe the data.
Apache Hive : LanguageManual Joins
Dec 12, 2024Apache Hive : LanguageManual Joins
Join Syntax
Hive supports the following syntax for joining tables:
join_table:
table_reference [INNER] JOIN table_factor [join_condition]
| table_reference {LEFT|RIGHT|FULL} [OUTER] JOIN table_reference join_condition
| table_reference LEFT SEMI JOIN table_reference join_condition
| table_reference CROSS JOIN table_reference [join_condition] (as of Hive 0.10)
table_reference:
table_factor
| join_table
table_factor:
tbl_name [alias]
| table_subquery alias
| ( table_references )
join_condition:
ON expression
See Select Syntax for the context of this join syntax.
Apache Hive : LanguageManual LateralView
Dec 12, 2024Apache Hive : LanguageManual LateralView
Lateral View Syntax
lateralView: LATERAL VIEW udtf(expression) tableAlias AS columnAlias (',' columnAlias)*
fromClause: FROM baseTable (lateralView)*
Description
Lateral view is used in conjunction with user-defined table generating functions such as explode(). As mentioned in Built-in Table-Generating Functions, a UDTF generates zero or more output rows for each input row. A lateral view first applies the UDTF to each row of base table and then joins resulting output rows to the input rows to form a virtual table having the supplied table alias.
Apache Hive : LanguageManual LZO
Dec 12, 2024Apache Hive : LanguageManual LZO Compression
General LZO Concepts
LZO is a lossless data compression library that favors speed over compression ratio. See http://www.oberhumer.com/opensource/lzo and http://www.lzop.org for general information about LZO and see Compressed Data Storage for information about compression in Hive.
Imagine a simple data file that has three columns
- id
- first name
- last name
Let’s populate a data file containing 4 records:
19630001 john lennon
19630002 paul mccartney
19630003 george harrison
19630004 ringo starr
Let’s call the data file /path/to/dir/names.txt.
Apache Hive : LanguageManual ORC
Dec 12, 2024Apache Hive : LanguageManual ORC
ORC Files
ORC File Format
Version
Introduced in Hive version 0.11.0.
The Optimized Row Columnar (ORC) file format provides a highly efficient way to store Hive data. It was designed to overcome limitations of the other Hive file formats. Using ORC files improves performance when Hive is reading, writing, and processing data.
Compared with RCFile format, for example, ORC file format has many advantages such as:
Apache Hive : LanguageManual Sampling
Dec 12, 2024Apache Hive : LanguageManual Sampling
Sampling Syntax
Sampling Bucketized Table
table_sample: TABLESAMPLE (BUCKET x OUT OF y [ON colname])
The TABLESAMPLE clause allows the users to write queries for samples of the data instead of the whole table. The TABLESAMPLE clause can be added to any table in the FROM clause. The buckets are numbered starting from 1. colname indicates the column on which to sample each row in the table. colname can be one of the non-partition columns in the table or rand() indicating sampling on the entire row instead of an individual column. The rows of the table are ‘bucketed’ on the colname randomly into y buckets numbered 1 through y. Rows which belong to bucket x are returned.
Apache Hive : LanguageManual Select
Dec 12, 2024Apache Hive : LanguageManual Select
Select Syntax
[WITH CommonTableExpression (, CommonTableExpression)*] (Note: Only available starting with Hive 0.13.0)
SELECT [ALL | DISTINCT] select_expr, select_expr, ...
FROM table_reference
[WHERE where_condition]
[GROUP BY col_list]
[ORDER BY col_list]
[CLUSTER BY col_list
| [DISTRIBUTE BY col_list] [SORT BY col_list]
]
[LIMIT [offset,] rows]
- A SELECT statement can be part of a union query or a subquery of another query.
table_referenceindicates the input to the query. It can be a regular table, a view, a join construct or a subquery.- Table names and column names are case insensitive.
- In Hive 0.12 and earlier, only alphanumeric and underscore characters are allowed in table and column names.
- In Hive 0.13 and later, column names can contain any Unicode character (see HIVE-6013). Any column name that is specified within backticks (```) is treated literally. Within a backtick string, use double backticks (````) to represent a backtick character.
- To revert to pre-0.13.0 behavior and restrict column names to alphanumeric and underscore characters, set the configuration property
[hive.support.quoted.identifiers](#hive-support-quoted-identifiers)tonone. In this configuration, backticked names are interpreted as regular expressions. For details, see Supporting Quoted Identifiers in Column Names (attached to HIVE-6013). Also see REGEX Column Specification below.
- Simple query. For example, the following query retrieves all columns and all rows from table t1.
SELECT * FROM t1
Note
Apache Hive : LanguageManual SortBy
Dec 12, 2024Apache Hive : LanguageManual SortBy
Order, Sort, Cluster, and Distribute By
This describes the syntax of SELECT clauses ORDER BY, SORT BY, CLUSTER BY, and DISTRIBUTE BY. See Select Syntax for general information.
Syntax of Order By
The ORDER BY syntax in Hive QL is similar to the syntax of ORDER BY in SQL language.
colOrder: ( ASC | DESC )
colNullOrder: (NULLS FIRST | NULLS LAST) -- (Note: Available in Hive 2.1.0 and later)
orderBy: ORDER BY colName colOrder? colNullOrder? (',' colName colOrder? colNullOrder?)*
query: SELECT expression (',' expression)* FROM src orderBy
There are some limitations in the “order by” clause. In the strict mode (i.e., hive.mapred.mode=strict), the order by clause has to be followed by a “limit” clause. The limit clause is not necessary if you set hive.mapred.mode to nonstrict. The reason is that in order to impose total order of all results, there has to be one reducer to sort the final output. If the number of rows in the output is too large, the single reducer could take a very long time to finish.
Apache Hive : LanguageManual SubQueries
Dec 12, 2024Apache Hive : LanguageManual SubQueries
Subqueries in the FROM Clause
SELECT ... FROM (subquery) name ...
SELECT ... FROM (subquery) AS name ... (Note: Only valid starting with Hive 0.13.0)
Hive supports subqueries only in the FROM clause (through Hive 0.12). The subquery has to be given a name because every table in a FROM clause must have a name. Columns in the subquery select list must have unique names. The columns in the subquery select list are available in the outer query just like columns of a table. The subquery can also be a query expression with UNION. Hive supports arbitrary levels of subqueries.
Apache Hive : LanguageManual Transform
Dec 12, 2024Apache Hive : LanguageManual Transform
Transform/Map-Reduce Syntax
Users can also plug in their own custom mappers and reducers in the data stream by using features natively supported in the Hive language. e.g. in order to run a custom mapper script - map_script - and a custom reducer script - reduce_script - the user can issue the following command which uses the TRANSFORM clause to embed the mapper and the reducer scripts.
Apache Hive : LanguageManual Types
Dec 12, 2024Apache Hive : LanguageManual Data Types
Overview
This lists all supported data types in Hive. See Type System in the Tutorial for additional information.
For data types supported by HCatalog, see:
Numeric Types
TINYINT(1-byte signed integer, from-128to127)SMALLINT(2-byte signed integer, from-32,768to32,767)
INT/INTEGER (4-byte signed integer, from -2,147,483,648 to 2,147,483,647)
* [`BIGINT`](https://hive.apache.org/docs/latest/language/languagemanual-types#integral-types-tinyintsmallintintintegerbigint) (8-byte signed integer, from `-9,223,372,036,854,775,808` to `9,223,372,036,854,775,807`)
* `FLOAT` (4-byte single precision floating point number)
* `DOUBLE` (8-byte double precision floating point number)
* ```
DOUBLE PRECISION (alias for DOUBLE, only available starting with Hive [2.2.0](https://issues.apache.org/jira/browse/HIVE-13556))
DECIMALNUMERIC(same asDECIMAL, starting with Hive 3.0.0)
Date/Time Types
TIMESTAMP(Note: Only available starting with Hive 0.8.0)DATE(Note: Only available starting with Hive 0.12.0)INTERVAL(Note: Only available starting with Hive 1.2.0)
String Types
STRINGVARCHAR(Note: Only available starting with Hive 0.12.0)CHAR(Note: Only available starting with Hive 0.13.0)
Misc Types
BOOLEANBINARY(Note: Only available starting with Hive 0.8.0)
Complex Types
- arrays:
ARRAY<data_type>(Note: negative values and non-constant expressions are allowed as of Hive 0.14.) - maps:
MAP<primitive_type, data_type>(Note: negative values and non-constant expressions are allowed as of Hive 0.14.) - structs:
STRUCT<col_name : data_type [COMMENT col_comment], ...> - union:
UNIONTYPE<data_type, data_type, ...>(Note: Only available starting with Hive 0.7.0.)
Column Types
Integral Types (TINYINT, SMALLINT, INT/INTEGER, BIGINT)
Integral literals are assumed to be INT by default, unless the number exceeds the range of INT in which case it is interpreted as a BIGINT, or if one of the following postfixes is present on the number.
Apache Hive : LanguageManual UDF
Dec 12, 2024Apache Hive : LanguageManual Operators and User-Defined Functions
Overview
All Hive keywords are case-insensitive, including the names of Hive operators and functions.
In Beeline or the CLI, use the commands below to show the latest documentation:
SHOW FUNCTIONS;
DESCRIBE FUNCTION <function_name>;
DESCRIBE FUNCTION EXTENDED <function_name>;
Bug for expression caching when UDF nested in UDF or function
When hive.cache.expr.evaluation is set to true (which is the default) a UDF can give incorrect results if it is nested in another UDF or a Hive function. This bug affects releases 0.12.0, 0.13.0, and 0.13.1. Release 0.14.0 fixed the bug (HIVE-7314).
Apache Hive : LanguageManual Union
Dec 12, 2024Apache Hive : LanguageManual Union
Union Syntax
select_statement UNION [ALL | DISTINCT] select_statement UNION [ALL | DISTINCT] select_statement ...
UNION is used to combine the result from multiple SELECT statements into a single result set.
- Hive versions prior to 1.2.0 only support UNION ALL (bag union), in which duplicate rows are not eliminated.
- In Hive 1.2.0 and later, the default behavior for UNION is that duplicate rows are removed from the result. The optional DISTINCT keyword has no effect other than the default because it also specifies duplicate-row removal. With the optional ALL keyword, duplicate-row removal does not occur and the result includes all matching rows from all the SELECT statements.
You can mix UNION ALL and UNION DISTINCT in the same query. Mixed UNION types are treated such that a DISTINCT union overrides any ALL union to its left. A DISTINCT union can be produced explicitly by using UNION DISTINCT or implicitly by using UNION with no following DISTINCT or ALL keyword.
Apache Hive : LanguageManual VariableSubstitution
Dec 12, 2024Apache Hive : LanguageManual VariableSubstitution
Introduction
Hive is used for batch and interactive queries. Variable Substitution allows for tasks such as separating environment-specific configuration variables from code.
The Hive variable substitution mechanism was designed to avoid some of the code that was getting baked into the scripting language on top of Hive.
Examples such as the following shell commands may (inefficiently) be used to set variables within a script:
$ a=b
$ hive -e " describe $a "
This is frustrating as Hive becomes closely coupled with scripting languages. The Hive startup time of a couple seconds is non-trivial when doing thousands of manipulations such as multiple hive -e invocations.
Apache Hive : LanguageManual VirtualColumns
Dec 12, 2024Apache Hive : LanguageManual VirtualColumns
Virtual Columns
Hive 0.8.0 provides support for two virtual columns:
One is INPUT__FILE__NAME, which is the input file’s name for a mapper task.
the other is BLOCK__OFFSET__INSIDE__FILE, which is the current global file position.
For block compressed file, it is the current block’s file offset, which is the current block’s first byte’s file offset.
Since Hive 0.8.0 the following virtual columns have been added:
- ROW__OFFSET__INSIDE__BLOCK
- RAW__DATA__SIZE
- ROW__ID
- GROUPING__ID
It is important to note, that all of the virtual columns listed here cannot be used for any other purpose (i.e. table creation with columns having a virtual column will fail with “SemanticException Error 10328: Invalid column name..”)
Apache Hive : LanguageManual WindowingAndAnalytics
Dec 12, 2024Apache Hive : LanguageManual WindowingAndAnalytics
Enhancements to Hive QL
Introduced in Hive version 0.11.
This section introduces the Hive QL enhancements for windowing and analytics functions. See “Windowing Specifications in HQL” (attached to HIVE-4197) for details. HIVE-896 has more information, including links to earlier documentation in the initial comments.
All of the windowing and analytics functions operate as per the SQL standard.
The current release supports the following functions for windowing and analytics:
Apache Hive : LanguageManual XPathUDF
Dec 12, 2024Apache Hive : LanguageManual XPathUDF
Documentation for Built-In User-Defined Functions Related To XPath
UDFs
xpath, xpath_short, xpath_int, xpath_long, xpath_float, xpath_double, xpath_number, xpath_string
- Functions for parsing XML data using XPath expressions.
- Since version: 0.6.0
Overview
The xpath family of UDFs are wrappers around the Java XPath library javax.xml.xpath provided by the JDK. The library is based on the XPath 1.0 specification. Please refer to http://java.sun.com/javase/6/docs/api/javax/xml/xpath/package-summary.html for detailed information on the Java XPath library.
Apache Hive : Literals
Dec 12, 2024Apache Hive : Literals
Literals
Integral types
Integral literals are assumed to be INT by default, unless the number exceeds the range of INT in which case it is interpreted as a BIGINT, or if one of the following postfixes is present on the number.
| Type | Postfix | Example |
|---|---|---|
| TINYINT | Y | 100Y |
| SMALLINT | S | 100S |
| BIGINT | L | 100L |
String types
String literals can be expressed with either single quotes (’) or double quotes ("). Hive uses C-style escaping within the strings.
Apache Hive : Managed vs. External Tables
Dec 12, 2024Apache Hive : Managed vs. External Tables
Hive fundamentally knows two different types of tables:
- Managed (Internal)
- External
Introduction
This document lists some of the differences between the two but the fundamental difference is that Hive assumes that it owns the data for managed tables. That means that the data, its properties and data layout will and can only be changed via Hive command. The data still lives in a normal file system and nothing is stopping you from changing it without telling Hive about it. If you do though it violates invariants and expectations of Hive and you might see undefined behavior.
Apache Hive : Materialized views
Dec 12, 2024Apache Hive : Materialized views
This page documents the work done for the supporting materialized views in Apache Hive.
Version information
Materialized views support is introduced in Hive 3.0.0.
Objectives
Traditionally, one of the most powerful techniques used to accelerate query processing in data warehouses is the pre-computation of relevant summaries or materialized views.
The initial implementation introduced in Apache Hive 3.0.0 focuses on introducing materialized views and automatic query rewriting based on those materializations in the project. In particular, materialized views can be stored natively in Hive or in other systems such as Druid using custom storage handlers, and they can seamlessly exploit new exciting Hive features such as LLAP acceleration. Then the optimizer relies in Apache Calcite to automatically produce full and partial rewritings for a large set of query expressions comprising projections, filters, join, and aggregation operations.
Apache Hive : OperatorsAndFunctions
Dec 12, 2024Apache Hive : OperatorsAndFunctions
Hive Operators and Functions
Apache Hive : Partition Filter Syntax
Dec 12, 2024Apache Hive : Partition Filter Syntax
Example: for a table having partition keys country and state, one could construct the following filter:
country = "USA" AND (state = "CA" OR state = "AZ")
In particular notice that it is possible to nest sub-expressions within parentheses.
The following operators are supported when constructing filters for partition columns (derived from HIVE-1862):
=<<=>>=<>ANDORLIKE(on keys of typestringonly, supports literal string template with ‘.*'wildcard)
Apache Hive : ReflectUDF
Dec 12, 2024Apache Hive : ReflectUDF
Reflect (Generic) UDF
A Java class and method often exists to handle the exact function a user would like to use in Hive. Rather than having to write a wrapper UDF to call this method, the majority of these methods can be called using reflect UDF. Reflect uses Java reflection to instantiate and call methods of objects; it can also call static functions. The method must return a primitive type or a type that Hive knows how to serialize.
Apache Hive : Scheduled Queries
Dec 12, 2024Apache Hive : Scheduled Queries
Introduction
Executing statements periodically can be usefull in
- Pulling informations from external systems
- Periodically updating column statistics
- Rebuilding materialized views
Overview
- The metastore maintains the scheduled queries in the metastore database
- Hiveserver(s) periodically polls the metastore for a scheduled query to be executed
- During execution informations about ongoing/finished executions are kept in the metastore
Scheduled queries were added in Hive 4.0 (HIVE-21884)
Hive has it’s scheduled query interface built into the language itself for easy access:
Apache Hive : SQL Standard Based Hive Authorization
Dec 12, 2024Apache Hive : SQL Standard Based Hive Authorization
Status of Hive Authorization before Hive 0.13
The default authorization in Hive is not designed with the intent to protect against malicious users accessing data they should not be accessing. It only helps in preventing users from accidentally doing operations they are not supposed to do. It is also incomplete because it does not have authorization checks for many operations including the grant statement. The authorization checks happen during Hive query compilation. But as the user is allowed to execute dfs commands, user-defined functions and shell commands, it is possible to bypass the client security checks.
Apache Hive : StatisticsAndDataMining
Dec 12, 2024Apache Hive : Statistics and Data Mining
This page is the secondary documentation for the slightly more advanced statistical and data mining functions that are being integrated into Hive, and especially the functions that warrant more than one-line descriptions.
ngrams() and context_ngrams(): N-gram frequency estimation
N-grams are subsequences of length N drawn from a longer sequence. The purpose of the ngrams() UDAF is to find the k most frequent n-grams from one or more sequences. It can be used in conjunction with the sentences() UDF to analyze unstructured natural language text, or the collect() function to analyze more general string data.
Apache Hive : Supported Features: Apache Hive 3.1
Dec 12, 2024Apache Hive : Supported Features: Apache Hive 3.1
This table covers all mandatory features from SQL:2016 as well as optional features that Hive implements.
| Feature ID | Feature Name | Implemented | Mandatory | Comments |
|---|---|---|---|---|
| E011 | Numeric data types | Yes | Mandatory | |
| E011-01 | INTEGER and SMALLINT data types (including all spellings) | Yes | Mandatory | |
| E011-02 | REAL, DOUBLE PRECISON, and FLOAT data types | Yes | Mandatory | |
| E011-03 | DECIMAL and NUMERIC data types | Yes | Mandatory | |
| E011-04 | Arithmetic operators | Yes | Mandatory | |
| E011-05 | Numeric comparison | Yes | Mandatory | |
| E011-06 | Implicit casting among the numeric data types | Yes | Mandatory | |
| E021 | Character string types | Yes | Mandatory | |
| E021-01 | CHARACTER data type (including all its spellings) | Partial | Mandatory | Only support CHAR, not CHARACTER |
| E021-02 | CHARACTER VARYING data type (including all its spellings) | Partial | Mandatory | Only support VARCHAR, not CHARACTER VARYING or CHAR VARYING |
| E021-03 | Character literals | Yes | Mandatory | |
| E021-04 | CHARACTER_LENGTH function | Yes | Mandatory | |
| E021-05 | OCTET_LENGTH function | Yes | Mandatory | |
| E021-06 | SUBSTRING function | Partial | Mandatory | Standard: SUBSTRING(val FROM startpos [FOR len]). Hive: SUBSTRING(val, startpos [, len]) |
| E021-07 | Character concatenation | Yes | Mandatory | |
| E021-08 | UPPER and LOWER functions | Yes | Mandatory | |
| E021-09 | TRIM function | Yes | Mandatory | |
| E021-10 | Implicit casting among the fixed-length and variable-length character string types | Yes | Mandatory | |
| E021-11 | POSITION function | No | Mandatory | |
| E021-12 | Character comparison | Yes | Mandatory | |
| E031 | Identifiers | Partial | Mandatory | Unquoted identifiers use C syntax ([A-Za-z][A-Za-z0-9_]*). Quoted identifiers can have any character. |
| E031-01 | Delimited identifiers | Partial | Mandatory | Quoting done with ` rather than “, only supported for columns, not tables, views, etc. |
| E031-02 | Lower case identifiers | Yes | Mandatory | |
| E031-03 | Trailing underscore | Yes | Mandatory | |
| E051 | Basic query specification | Yes | Mandatory | |
| E051-01 | SELECT DISTINCT | Yes | Mandatory | |
| E051-02 | GROUP BY clause | Yes | Mandatory | |
| E051-04 | GROUP BY can contain columns not in | Yes | Mandatory | |
| E051-05 | Select list items can be renamed | Yes | Mandatory | |
| E051-06 | HAVING clause | Yes | Mandatory | |
| E051-07 | Qualified * in select list | Yes | Mandatory | |
| E051-08 | Correlation names in the FROM clause | Yes | Mandatory | |
| E051-09 | Rename columns in the FROM clause | Yes | Mandatory | |
| E061 | Basic predicates and search conditions | Yes | Mandatory | |
| E061-01 | Comparison predicate | Yes | Mandatory | |
| E061-02 | BETWEEN predicate | Yes | Mandatory | |
| E061-03 | IN predicate with list of values | Yes | Mandatory | |
| E061-04 | LIKE predicate | Yes | Mandatory | |
| E061-05 | LIKE predicate: ESCAPE clause | Yes | Mandatory | |
| E061-06 | NULL predicate | Yes | Mandatory | |
| E061-07 | Quantified comparison predicate | No | Mandatory | |
| E061-08 | EXISTS predicate | Yes | Mandatory | |
| E061-09 | Subqueries in comparison predicate | No | Mandatory | |
| E061-11 | Subqueries in IN predicate | Yes | Mandatory | |
| E061-12 | Subqueries in quantified comparison predicate | No | Mandatory | |
| E061-13 | Correlated subqueries | Yes | Mandatory | |
| E061-14 | Search condition | Yes | Mandatory | |
| E071 | Basic query expressions | Yes | Mandatory | |
| E071-01 | UNION DISTINCT table operator | Yes | Mandatory | |
| E071-02 | UNION ALL table operator | Yes | Mandatory | |
| E071-03 | EXCEPT DISTINCT table operator | Yes | Mandatory | |
| E071-05 | Columns combined via table operators need not have exactly the same data type. | Yes | Mandatory | |
| E071-06 | Table operators in subqueries | Yes | Mandatory | |
| E081 | Basic Privileges | Yes | Mandatory | |
| E081-01 | SELECT privilege at the table level | Yes | Mandatory | |
| E081-02 | DELETE privilege | Yes | Mandatory | |
| E081-03 | INSERT privilege at the table level | Yes | Mandatory | |
| E081-04 | UPDATE privilege at the table level | Yes | Mandatory | |
| E081-05 | UPDATE privilege at the column level | Yes | Mandatory | |
| E081-06 | REFERENCES privilege at the table level | No | Mandatory | |
| E081-07 | REFERENCES privilege at the column level | No | Mandatory | |
| E081-08 | WITH GRANT OPTION | Yes | Mandatory | |
| E081-09 | USAGE privilege | No | Mandatory | |
| E081-10 | EXECUTE privilege | No | Mandatory | |
| E091 | Set functions | Yes | Mandatory | |
| E091-01 | AVG | Yes | Mandatory | |
| E091-02 | COUNT | Yes | Mandatory | |
| E091-03 | MAX | Yes | Mandatory | |
| E091-04 | MIN | Yes | Mandatory | |
| E091-05 | SUM | Yes | Mandatory | |
| E091-06 | ALL quantifier | Yes | Mandatory | |
| E091-07 | DISTINCT quantifier | Yes | Mandatory | |
| E101 | Basic data manipulation | Yes | Mandatory | |
| E101-01 | INSERT statement | Yes | Mandatory | |
| E101-03 | Searched UPDATE statement | Yes | Mandatory | |
| E101-04 | Searched DELETE statement | Yes | Mandatory | |
| E111 | Single row SELECT statement | No | Mandatory | |
| E121 | Basic cursor support | No | Mandatory | |
| E121-01 | DECLARE CURSOR | No | Mandatory | |
| E121-02 | ORDER BY columns need not be in select list | No | Mandatory | |
| E121-03 | Value expressions in ORDER BY clause | No | Mandatory | |
| E121-04 | OPEN statement | No | Mandatory | |
| E121-06 | Positioned UPDATE statement | No | Mandatory | |
| E121-07 | Positioned DELETE statement | No | Mandatory | |
| E121-08 | CLOSE statement | No | Mandatory | |
| E121-10 | FETCH statement: implicit NEXT | No | Mandatory | |
| E121-17 | WITH HOLD cursors | No | Mandatory | |
| E131 | Null value support (nulls in lieu of values) | Yes | Mandatory | |
| E141 | Basic integrity constraints | Partial | Mandatory | Don’t support UNIQUE (VALUE) constraints, don’t support UNIQUE over a list of columns. Unique constraints not enforced.Don’t support referencing periods, MATCH, or triggered actions in foreign key.Don’t support CHECK constraints. |
| E141-01 | NOT NULL constraints | Yes | Mandatory | |
| E141-02 | UNIQUE constraints of NOT NULL columns | Partial | Mandatory | UNIQUE constraints not enforced |
| E141-03 | PRIMARY KEY constraints | Partial | Mandatory | Primary keys not enforced |
| E141-04 | Basic FOREIGN KEY constraint with the NO ACTION default for both referential delete action and referential update action. | Partial | Mandatory | Don’t support referencing periods, MATCH, or triggered actions. Foreign keys not enforced. |
| E141-06 | CHECK constraints | Yes | Mandatory | |
| E141-07 | Column defaults | Yes | Mandatory | |
| E141-08 | NOT NULL inferred on PRIMARY KEY | No | Mandatory | No need to declare NOT NULL with PRIMARY KEY or UNIQUE, but non-nullness not enforced. |
| E141-10 | Names in a foreign key can be specified in any order | No | Mandatory | |
| E151 | Transaction support | No | Mandatory | |
| E151-01 | COMMIT statement | No | Mandatory | |
| E151-02 | ROLLBACK statement | No | Mandatory | |
| E152 | Basic SET TRANSACTION statement | No | Mandatory | |
| E152-01 | SET TRANSACTION state- ment: ISOLATION LEVEL SERIALIZABLE clause | No | Mandatory | |
| E152-02 | SET TRANSACTION state- ment: READ ONLY and READ WRITE clauses | No | Mandatory | |
| E153 | Updatable queries with subqueries | No | Mandatory | |
| E161 | SQL comments using leading double minus | Yes | Mandatory | |
| E171 | SQLSTATE support | No | Mandatory | |
| F031 | Basic schema manipulation | Yes | Mandatory | |
| F031-01 | CREATE TABLE statement to create persistent base tables | Yes | Mandatory | |
| F031-02 | CREATE VIEW statement | Yes | Mandatory | |
| F031-03 | GRANT statement | Yes | Mandatory | |
| F031-04 | ALTER TABLE statement: ADD COLUMN clause | Yes | Mandatory | |
| F031-13 | DROP TABLE statement: RESTRICT clause | Yes | Mandatory | |
| F031-16 | DROP VIEW statement: RESTRICT clause | Yes | Mandatory | |
| F031-19 | REVOKE statement: RESTRICT clause | No | Mandatory | |
| F032 | CASCADE drop behavior | Yes | Optional | |
| F034 | Extended REVOKE statement | Yes | Optional | |
| F034-01 | REVOKE statement performed by other than the owner of a schema object | Yes | Optional | |
| F034-02 | REVOKE statement: GRANT OPTION FOR clause | Yes | Optional | |
| F034-03 | REVOKE statement to revoke a privilege that the grantee has WITH GRANT OPTION | Yes | Optional | |
| F041 | Basic joined table | Yes | Mandatory | |
| F041-01 | Inner join (but not necessarily the INNER keyword) | Yes | Mandatory | |
| F041-02 | INNER keyword | Yes | Mandatory | |
| F041-03 | LEFT OUTER JOIN | Yes | Mandatory | |
| F041-04 | RIGHT OUTER JOIN | Yes | Mandatory | |
| F041-05 | Outer joins can be nested | Yes | Mandatory | |
| F041-07 | The inner table in a left or right outer join can also be used in an inner join | Yes | Mandatory | |
| F041-08 | All comparison operators are supported (rather than just =) | Yes | Mandatory | |
| F051 | Basic date and time | Partial | Mandatory | No support for WITH/OUT TIMEZONE.No support for precision in TIMESTAMP.No support for TIME type. |
| F051-01 | DATE data type (including support of DATE literal) | Partial | Mandatory | Intervals don’t match spec syntax |
| F051-02 | TIME data type (including support of TIME literal) with fractional seconds precision of at least 0. | No | Mandatory | |
| F051-03 | TIMESTAMP data type (including support of TIMESTAMP literal) with fractional seconds precision of at least 0 and 6. | Partial | Mandatory | No support for WITH/OUT TIMEZONE.No support for precision.Intervals don’t match spec syntax. |
| F051-04 | Comparison predicate on DATE, TIME, and TIMESTAMP data types | Partial | Mandatory | No support for TIME |
| F051-05 | Explicit CAST between date-time types and character string types | Partial | Mandatory | No support for TIME |
| F051-06 | CURRENT_DATE | Yes | Mandatory | |
| F051-07 | LOCALTIME | No | Mandatory | |
| F051-08 | LOCALTIMESTAMP | Partial | Mandatory | CURRENT_TIMESTAMP supported, doesn’t take precision argumentLOCALTIMESTAMP not supported |
| F052 | Intervals and datetime arithmetic | Partial | Optional | Interval not supported as column type, only as expression type in queries.Interval syntax differs from standard. |
| F054 | TIMESTAMP in DATE type precedence list | Yes | Optional | |
| F081 | UNION and EXCEPT in views | Yes | Mandatory | |
| F131 | Grouped operations | Yes | Mandatory | |
| F131-01 | WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views | Yes | Mandatory | |
| F131-02 | Multiple tables supported in queries with grouped views | Yes | Mandatory | |
| F131-03 | Set functions supported in queries with grouped views | Yes | Mandatory | |
| F131-04 | Subqueries with GROUP BY and HAVING clauses and grouped views | Yes | Mandatory | |
| F131-05 | Single row SELECT with GROUP BY and HAVING clauses and grouped views | Yes | Mandatory | |
| F171 | Multiple schemas per user | Yes | Optional | |
| F200 | TRUNCATE TABLE statement | Yes | Optional | |
| F181 | Multiple module support | No | Mandatory | |
| F201 | CAST function | Yes | Mandatory | |
| F221 | Explicit defaults | Yes | Mandatory | |
| F261 | CASE expression | Yes | Mandatory | |
| F261-01 | Simple CASE | Yes | Mandatory | |
| F261-02 | Searched CASE | Yes | Mandatory | |
| F261-03 | NULLIF | Yes | Mandatory | |
| F261-04 | COALESCE | Yes | Mandatory | |
| F302 | INTERSECT table operator | Yes | Optional | |
| F302-01 | INTERSECT DISTINCT table operator | Yes | Optional | |
| F302-02 | INTERSECT ALL table operator | Yes | Optional | |
| F304 | EXCEPT ALL table operator | Yes | Optional | |
| F311 | Schema definition statement | Yes | Mandatory | |
| F311-01 | CREATE SCHEMA | Yes | Mandatory | |
| F311-02 | CREATE TABLE for persistent base tables | Partial | Mandatory | Does not create schema element creation as part of schema creation, must be done in separate statement |
| F311-03 | CREATE VIEW | Partial | Mandatory | Does not create schema element creation as part of schema creation, must be done in separate statement |
| F311-04 | CREATE VIEW: WITH CHECK OPTION | No | Mandatory | |
| F311-05 | GRANT statement | Partial | Mandatory | Does not create schema element creation as part of schema creation, must be done in separate statement |
| F312 | MERGE statement | Yes | Optional | |
| F313 | Enhanced MERGE statement | Yes | Optional | |
| F314 | MERGE statement with DELETE branch | Yes | Optional | |
| F321 | User authorization | Partial | Optional | Support for CURRENT_USER function, none of the rest |
| F381 | Extended schema manipulation | Partial | Optional | No support for scope.No support for ALTER routine. |
| F381-01 | ALTER TABLE statement: ALTER COLUMN clause | Partial | Optional | Syntax non-standard.No support for scope.No support for identities.No support for column generation. |
| F381-02 | ALTER TABLE statement: ADD CONSTRAINT clause | Partial | Optional | Same limitations as creating constraints above |
| F381-03 | ALTER TABLE statement: DROP CONSTRAINT clause | Partial | Optional | Same limitations as creating constraints above |
| F382 | Alter column data type | Partial | Optional | Syntax non-standard |
| F383 | Set column not null clause | Partial | Optional | Syntax non-standard |
| F391 | Long identifiers | Yes | Optional | |
| F401 | Extended joined table | Partial | Optional | NATURAL joins not supported |
| F401-02 | FULL OUTER JOIN | Yes | Optional | |
| F401-04 | CROSS JOIN | Yes | Optional | |
| F471 | Scalar subquery values | Yes | Mandatory | |
| F481 | Expanded NULL predicate | Yes | Mandatory | |
| F531 | Temporary tabels | Partial | Optional | GLOBAL/LOCAL scope not supported.DECLARE TEMPORARY TABLE not supported. |
| F555 | Enhanced seconds precision | Yes | Optional | |
| F763 | CURRENT_SCHEMA | Partial | Optional | CURRENT_DATABASE, which is equivalent |
| F812 | Basic flagging | No | Mandatory | |
| F841 | LIKE_REGEX predicate | Partial | Optional | use RLIKE instead |
| F847 | Nonconstant regular expressions | Yes | Optional | |
| F850 | Top level in | Yes | Optional | |
| F851 | in subqueries | Yes | Optional | |
| F852 | Top-level in views | Yes | Optional | |
| F855 | Nested in | Yes | Optional | |
| F856 | Nested in | Yes | Optional | |
| F857 | Top-level in | Yes | Optional | |
| F858 | in subqueries | Yes | Optional | |
| F859 | Top-level in views | Yes | Optional | |
| S011 | Distinct data types | No | Mandatory | |
| S091 | Basic array support | Partial | Optional | Syntax non-standard.No option to declare max cardinality.SIZE instead of CARDINALITY. |
| S091-01 | Arrays of built-in data types | Partial | Optional | Syntax non-standard |
| S091-03 | Array expressions | Partial | Optional | Support array element reference and cardinality (though syntax non-standard)No support for array concatenation, trimming, or max-cardinality |
| T021 | BINARY and VARBINARY types | Partial | Optional | BINARY only, though it acts like VARBINARY, no length parameter accepted.No support for overlay, trim, position, or LIKE. |
| T031 | BOOLEAN data type | Yes | Optional | |
| T041 | Basic LOB data type support | Partial | Optional | BINARY acts as BLOB (no size restrictions)STRING acts as CLOBNon-standard syntax |
| T041-01 | BLOB data type | Partial | Optional | BINARY acts as BLOB, non-standard syntax |
| T041-02 | CLOB data type | Partial | Optional | STRING acts as CLOB, non-standard syntax |
| T041-03 | POSITION, LENGTH, LOWER, TRIM, UPPER, SUBSTRING for LOB data types | Partial | Optional | No POSITIONLOWER, UPPER only applicable to STRING |
| T041-04 | Concatenation of LOB types | Yes | Optional | |
| T042 | Extended LOB data type support | Partial | Optional | Cast for BINARY and STRING supported.LIKE for STRING supported.All other advanced options not supported. |
| T051 | Row types | Partial | Optional | Called STRUCT rather than ROW |
| T071 | BIGINT data type | Yes | Optional | |
| T121 | WITH (excluding RECURSIVE) in query expression | Yes | Optional | |
| T321 | Basic SQL-invoked routines | No | Mandatory | |
| T321-01 | User-defined functions with no overloading | No | Mandatory | |
| T321-02 | User-defined stored procedures with no overloading | No | Mandatory | |
| T321-03 | Function invocation | No | Mandatory | |
| T321-04 | CALL statement | No | Mandatory | |
| T321-05 | RETURN statement | No | Mandatory | |
| T331 | Basic roles | Yes | Optional | |
| T351 | Bracketed comments | Yes | Optional | |
| T431 | Extended grouping capabilities | Yes | Optional | |
| T433 | Multiargument GROUPING function | Yes | Optional | |
| T441 | ABS and MOD functions | Yes | Optional | |
| T501 | Enhanced EXISTS predicate | Yes | Optional | |
| T581 | Regular expression substring function | Yes | Optional | |
| T591 | UNIQUE constraints of possibly null columns | Yes | Optional | |
| T611 | Elementary OLAP operations | Yes | Optional | |
| T612 | Advanced OLAP operations | Partial | Optional | |
| T613 | Sampling | Yes | Optional | |
| T614 | NTILE function | Yes | Optional | |
| T615 | LEAD and LAG functions | Yes | Optional | |
| T617 | FIRST_VALUE and LAST_VALUE functions | Yes | Optional | |
| T621 | Enhanced numeric functions | Yes | Optional | |
| T622 | Trigonometric functions | Partial | Optional | No sinh, cosh, tanh |
| T623 | General logarithm functions | Yes | Optional | |
| T624 | Common logarithm functions | Yes | Optional | |
| T631 | IN predicate with one list element | Yes | Mandatory |
Apache Hive : Supported Features: Apache Hive 2.1
Dec 12, 2024Apache Hive : Supported Features: Apache Hive 2.1
| Identifier | Description | Hive 2.1 | Comment |
|---|---|---|---|
| E011 | Numeric data types | Yes | |
| E011-01 | INTEGER and SMALLINT data types (including all spellings) | Yes | Int instead of Integer |
| E011-02 | REAL, DOUBLE PRECISON,and FLOAT data types | Yes | Double instead of Double Precision |
| E011-03 | DECIMAL and NUMERIC data types | Yes | |
| E011-04 | Arithmetic operators | Yes | |
| E011-05 | Numeric comparison | Yes | |
| E011-06 | Implicit casting among the numeric data types | Yes | |
| E021 | Character data types | Yes | |
| E021-01 | CHARACTER data type | Yes | Char instead of Character |
| E021-02 | CHARACTER VARYING data type | Yes | Varchar instead of Character Varying |
| E021-03 | Character literals | Yes | |
| E021-04 | CHARACTER_LENGTH function | Partial | length UDF provided |
| E021-06 | SUBSTRING function | Yes | |
| E021-07 | Character concatenation | Yes | concat UDF instead of standard |
| E021-08 | UPPER and LOWER functions | Yes | |
| E021-09 | TRIM function | Partial | leading / trailing / both from not supported |
| E021-10 | Implicit casting among the fixed-length and variablelength character string types | Yes | |
| E021-12 | Character comparison | Yes | |
| E031 | Identifiers | Yes | |
| E031-01 | Delimited identifiers | Partial | Backtick (`) used instead of ("). Semicolon character (;) cannot be used in an identifier. Table and column names have additional restrictions |
| E031-03 | Trailing underscore | Yes | |
| E051 | Basic query specification | Yes | |
| E051-01 | SELECT DISTINCT | Yes | |
| E051-02 | GROUP BY clause | Partial | Empty grouping sets not supported |
| E051-04 | GROUP BY can contain columns not in | Yes | |
| E051-05 | Select list items can be renamed | Yes | |
| E051-06 | HAVING clause | Yes | |
| E051-07 | Qualified * in select list | Yes | |
| E051-08 | Correlation names in the FROM clause | Yes | |
| E061 | Basic predicates and search conditions | Yes | |
| E061-01 | Comparison predicate | Yes | |
| E061-02 | BETWEEN predicate | Yes | |
| E061-03 | IN predicate with list of values | Yes | |
| E061-04 | LIKE predicate | Yes | |
| E061-06 | NULL predicate | Yes | |
| E061-08 | EXISTS predicate | Yes | |
| E061-11 | Subqueries in IN predicate | Yes | |
| E061-13 | Correlated subqueries | Partial | Only correlated subqueries that can be decorrelated with rewrite rules supported |
| E071 | Basic query expressions | Yes | |
| E071-01 | UNION DISTINCT table operator | Partial | Corresponding By syntax not supported |
| E071-02 | UNION ALL table operator | Partial | Corresponding By syntax not supported |
| E071-05 | Columns combined via table operators need not have exactly the same data type. | Yes | |
| E071-06 | Table operators in subqueries | Yes | |
| E081 | Basic Privileges | Yes | |
| E081-01 | SELECT privilege | Yes | |
| E081-03 | INSERT privilege at the table level | Yes | |
| E081-04 | UPDATE privilege at the table level | Yes | |
| E081-08 | WITH GRANT OPTION | Yes | |
| E091 | Set Functions | Yes | |
| E091-01 | AVG | Yes | |
| E091-02 | COUNT | Yes | |
| E091-03 | MAX | Yes | |
| E091-04 | MIN | Yes | |
| E091-05 | SUM | Yes | |
| E091-07 | DISTINCT quantifier | Yes | |
| E101 | Basic data manipulation | Yes | |
| E101-01 | INSERT statement | Yes | |
| E101-03 | Searched UPDATE statement | Yes | |
| E101-04 | Searched DELETE statement | Yes | |
| E131 | Null value support (nulls in lieu of values) | Partial | Null specification is supported |
| E141 | Basic integrity constraints | Yes | |
| E141-03 | PRIMARY KEY constraints | Partial | Non-validated |
| E141-04 | Basic FOREIGN KEY constraint with the NO ACTION default for both referential delete action and referential update action | Partial | Non-validated |
| E141-10 | Names in a foreign key can be specified in any order | Yes | |
| E151 | Transaction support | Partial | Autocommit transaction for INSERT/UPDATE/DELETE |
| E161 | SQL comments using leading double minus | Yes | |
| F031 | Basic schema manipulation | Yes | |
| F031-01 | CREATE TABLE statement to create persistent base tables | Yes | |
| F031-02 | CREATE VIEW statement | Yes | |
| F031-03 | GRANT statement | Yes | |
| F031-04 | ALTER TABLE statement: ADD COLUMN clause | Yes | |
| F031-13 | DROP TABLE statement: RESTRICT clause | Yes | |
| F031-16 | DROP VIEW statement: RESTRICT clause | Yes | |
| F041 | Basic joined table | Yes | |
| F041-01 | Inner join (but not necessarily the INNER keyword) | Yes | Named columns join not supported |
| F041-02 | INNER keyword | Yes | |
| F041-03 | LEFT OUTER JOIN | Yes | |
| F041-04 | RIGHT OUTER JOIN | Yes | |
| F041-05 | Outer joins can be nested | Yes | |
| F041-07 | The inner table in a left or right outer join can also be used in an inner join | Yes | |
| F051 | Basic date and time | Yes | |
| F051-01 | DATE data type (including support of DATE literal) | Yes | |
| F051-03 | TIMESTAMP data type (including support of TIMES- TAMP literal) with fractional seconds precision of at least 0 and 6. | Yes | |
| F051-04 | Comparison predicate on DATE, TIME, and TIMES- TAMP data types | Yes | |
| F051-05 | Explicit CAST between date- time types and character string types | Yes | |
| F051-06 | CURRENT_DATE | Yes | |
| F052 | Intervals and datetime arithmetic | Yes | |
| F081 | UNION and EXCEPT in views | Partial | UNION only |
| F131 | Grouped operations | Yes | |
| F131-01 | WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views | Yes | |
| F131-02 | Multiple tables supported in queries with grouped views | Yes | |
| F131-03 | Set functions supported in queries with grouped views | Yes | |
| F131-04 | Subqueries with GROUP BY and HAVING clauses and grouped views | Yes | |
| F171 | Multiple schemas per user | Yes | |
| F200 | TRUNCATE TABLE statement | Yes | |
| F201 | CAST function | Yes | |
| F261 | CASE expression | Yes | |
| F261-01 | Simple CASE | Yes | |
| F261-02 | Searched CASE | Yes | |
| F261-04 | COALESCE | Yes | |
| F311-01 | CREATE SCHEMA | Yes | |
| F311-02 | CREATE TABLE for persistent base tables | Yes | |
| F311-03 | CREATE VIEW | Yes | |
| F311-05 | GRANT statement | Yes | |
| F382 | Alter column data type | Yes | Uses nonstandard syntax |
| F391 | Long identifiers | Yes | |
| F401 | Extended joined table | Yes | |
| F401-01 | NATURAL JOIN | Yes | |
| F401-02 | FULL OUTER JOIN | Yes | |
| F401-04 | CROSS JOIN | Yes | |
| F403 | Partitioned join tables | Yes | |
| F531 | Temporary tables | Yes | |
| F555 | Enhanced seconds precision | Yes | |
| F561 | Full value expressions | Yes | |
| F591 | Derived tables | Yes | |
| F641 | Row and table constructors | Yes | |
| F651 | Catalog name qualifiers | Yes | |
| F846 | Octet support in regular expression operators | Yes | |
| F847 | Nonconstant regular expressions | Yes | |
| F850 | Top-level in | Yes | |
| F851 | in subqueries | Yes | |
| F852 | Top-level in views | Yes | |
| F855 | Nested in | Yes | |
| S023 | Basic structured types | Yes | |
| S091 | Basic array support | Yes | |
| S091-01 | Arrays of built-in data types | Yes | |
| S091-02 | Arrays of distinct types | Yes | |
| S098 | ARRAY_AGG | Partial | collect_list does the same |
| S201-01 | Array parameters | Yes | |
| S281 | Nested collection types | Yes | |
| T021 | BINARY and VARBINARY data types | Partial | BINARY only |
| T031 | BOOLEAN data type | Yes | |
| T051 | Row types | Yes | |
| T071 | BIGINT data type | Yes | |
| T121 | WITH (excluding RECURSIVE) in query expression | Yes | |
| T122 | WITH (excluding RECURSIVE) in subquery | Yes | |
| T172 | AS subquery clause in table definition | Yes | |
| T326 | Table functions | Yes | |
| T331 | Basic roles | Yes | |
| T431 | Extended grouping capabilities | Partial | Grouping sets need to be extracted manually from a bitmask |
| T433 | Multiargument GROUPING function | Yes | |
| T441 | ABS and MOD functions | Partial | ABS provided, MOD provided via % operator |
| T501 | Enhanced EXISTS predicate | Yes | |
| T581 | Regular expression substring function | Yes | |
| T611 | Elementary OLAP operations | Yes | |
| T612 | Advanced OLAP operations | Partial | PERCENT_RANK, CUME_DIST and ROW_NUMBER supported |
| T613 | Sampling | Yes | Nonstandard syntax via TABLESAMPLE |
| T614 | NTILE function | Yes | |
| T615 | LEAD and LAG functions | Yes | |
| T616 | Null treatment option for LEAD and LAG functions | Yes | |
| T617 | FIRST_VALUE and LAST_VALUE functions | Yes | |
| T621 | Enhanced numeric functions | Yes | |
| T631 | IN predicate with one list element | Yes |
Apache Hive : Supported Features: Apache Hive 2.3
Dec 12, 2024Apache Hive : Supported Features: Apache Hive 2.3
| Identifier | Description | Hive 2.3 | Comment |
|---|---|---|---|
| E011 | Numeric data types | Yes | |
| E011-01 | INTEGER and SMALLINT data types (including all spellings) | Yes | |
| E011-02 | REAL, DOUBLE PRECISON,and FLOAT data types | Yes | |
| E011-03 | DECIMAL and NUMERIC data types | Yes | |
| E011-04 | Arithmetic operators | Yes | |
| E011-05 | Numeric comparison | Yes | |
| E011-06 | Implicit casting among the numeric data types | Yes | |
| E021 | Character data types | Yes | |
| E021-01 | CHARACTER data type | Yes | Char instead of Character |
| E021-02 | CHARACTER VARYING data type | Yes | Varchar instead of Character Varying |
| E021-03 | Character literals | Yes | |
| E021-04 | CHARACTER_LENGTH function | Yes | |
| E021-05 | OCTET_LENGTH function | Yes | |
| E021-06 | SUBSTRING function | Yes | |
| E021-07 | Character concatenation | Yes | |
| E021-08 | UPPER and LOWER functions | Yes | |
| E021-09 | TRIM function | Partial | leading / trailing / both from not supported |
| E021-10 | Implicit casting among the fixed-length and variablelength character string types | Yes | |
| E021-12 | Character comparison | Yes | |
| E031 | Identifiers | Yes | |
| E031-01 | Delimited identifiers | Yes | |
| E031-03 | Trailing underscore | Yes | |
| E051 | Basic query specification | Yes | |
| E051-01 | SELECT DISTINCT | Yes | |
| E051-02 | GROUP BY clause | Partial | Empty grouping sets not supported |
| E051-04 | GROUP BY can contain columns not in | Yes | |
| E051-05 | Select list items can be renamed | Yes | |
| E051-06 | HAVING clause | Yes | |
| E051-07 | Qualified * in select list | Yes | |
| E051-08 | Correlation names in the FROM clause | Yes | |
| E061 | Basic predicates and search conditions | Yes | |
| E061-01 | Comparison predicate | Yes | |
| E061-02 | BETWEEN predicate | Yes | |
| E061-03 | IN predicate with list of values | Yes | |
| E061-04 | LIKE predicate | Yes | |
| E061-06 | NULL predicate | Yes | |
| E061-08 | EXISTS predicate | Yes | |
| E061-09 | Subqueries in comparison predicate | Yes | |
| E061-11 | Subqueries in IN predicate | Yes | |
| E061-13 | Correlated subqueries | Yes | |
| E071 | Basic query expressions | Yes | |
| E071-01 | UNION DISTINCT table operator | Yes | |
| E071-02 | UNION ALL table operator | Yes | |
| E071-03 | EXCEPT DISTINCT table operator | Yes | |
| E071-05 | Columns combined via table operators need not have exactly the same data type. | Yes | |
| E071-06 | Table operators in subqueries | Yes | |
| E081 | Basic Privileges | Yes | |
| E081-01 | SELECT privilege | Yes | |
| E081-03 | INSERT privilege at the table level | Yes | |
| E081-04 | UPDATE privilege at the table level | Yes | |
| E081-08 | WITH GRANT OPTION | Yes | |
| E091 | Set Functions | Yes | |
| E091-01 | AVG | Yes | |
| E091-02 | COUNT | Yes | |
| E091-03 | MAX | Yes | |
| E091-04 | MIN | Yes | |
| E091-05 | SUM | Yes | |
| E091-06 | ALL quantifier | Yes | |
| E091-07 | DISTINCT quantifier | Yes | |
| E101 | Basic data manipulation | Yes | |
| E101-01 | INSERT statement | Yes | |
| E101-03 | Searched UPDATE statement | Yes | |
| E101-04 | Searched DELETE statement | Yes | |
| E131 | Null value support (nulls in lieu of values) | Yes | |
| E141 | Basic integrity constraints | Yes | |
| E141-03 | PRIMARY KEY constraints | Partial | Non-enforced |
| E141-04 | Basic FOREIGN KEY constraint with the NO ACTION default for both referential delete action and referential update action | Partial | Non-enforced |
| E141-08 | NOT NULL inferred on PRIMARY KEY | Partial | Inferred on read |
| E141-10 | Names in a foreign key can be specified in any order | Yes | |
| E151 | Transaction support | Partial | Autocommit transaction for INSERT/UPDATE/DELETE/MERGE |
| E161 | SQL comments using leading double minus | Yes | |
| F031 | Basic schema manipulation | Yes | |
| F031-01 | CREATE TABLE statement to create persistent base tables | Yes | |
| F031-02 | CREATE VIEW statement | Yes | |
| F031-03 | GRANT statement | Yes | |
| F031-04 | ALTER TABLE statement: ADD COLUMN clause | Yes | |
| F031-13 | DROP TABLE statement: RESTRICT clause | Yes | |
| F031-16 | DROP VIEW statement: RESTRICT clause | Yes | |
| F041 | Basic joined table | Yes | |
| F041-01 | Inner join (but not necessarily the INNER keyword) | Yes | |
| F041-02 | INNER keyword | Yes | |
| F041-03 | LEFT OUTER JOIN | Yes | |
| F041-04 | RIGHT OUTER JOIN | Yes | |
| F041-05 | Outer joins can be nested | Yes | |
| F041-07 | The inner table in a left or right outer join can also be used in an inner join | Yes | |
| F041-08 | All comparison operators are supported (rather than just =) | Yes | |
| F051 | Basic date and time | Yes | |
| F051-01 | DATE data type (including support of DATE literal) | Yes | |
| F051-03 | TIMESTAMP data type (including support of TIMES- TAMP literal) with fractional seconds precision of at least 0 and 6. | Yes | |
| F051-04 | Comparison predicate on DATE, TIME, and TIMES- TAMP data types | Yes | |
| F051-05 | Explicit CAST between date- time types and character string types | Yes | |
| F051-06 | CURRENT_DATE | Yes | |
| F052 | Intervals and datetime arithmetic | Yes | |
| F054 | TIMESTAMP in DATE type precedence list | Yes | |
| F081 | UNION and EXCEPT in views | Yes | |
| F131 | Grouped operations | Yes | |
| F131-01 | WHERE, GROUP BY, and HAVING clauses supported in queries with grouped views | Yes | |
| F131-02 | Multiple tables supported in queries with grouped views | Yes | |
| F131-03 | Set functions supported in queries with grouped views | Yes | |
| F131-04 | Subqueries with GROUP BY and HAVING clauses and grouped views | Yes | |
| F171 | Multiple schemas per user | Yes | |
| F200 | TRUNCATE TABLE statement | Yes | |
| F201 | CAST function | Yes | |
| F261 | CASE expression | Yes | |
| F261-01 | Simple CASE | Yes | |
| F261-02 | Searched CASE | Yes | |
| F261-03 | NULLIF | Yes | |
| F261-04 | COALESCE | Yes | |
| F271 | Compound character literals | Yes | |
| F281 | LIKE enhancements | Partial | Escape characters not supported |
| F302 | INTERSECT table operator | Yes | |
| F302-01 | INTERSECT DISTINCT table operator | Yes | |
| F302-02 | INTERSECT ALL table operator | Yes | |
| F304 | EXCEPT ALL table operator | Yes | |
| F311-01 | CREATE SCHEMA | Partial | Database is used as the equivalent |
| F311-02 | CREATE TABLE for persistent base tables | Yes | |
| F311-03 | CREATE VIEW | Yes | |
| F311-05 | GRANT statement | Yes | |
| F312 | MERGE statement | Yes | |
| F314 | MERGE statement with DELETE branch | Yes | |
| F382 | Alter column data type | Yes | Uses nonstandard syntax |
| F391 | Long identifiers | Yes | |
| F401 | Extended joined table | Yes | |
| F401-01 | NATURAL JOIN | Yes | |
| F401-02 | FULL OUTER JOIN | Yes | |
| F401-04 | CROSS JOIN | Yes | |
| F403 | Partitioned join tables | Yes | |
| F531 | Temporary tables | Yes | |
| F555 | Enhanced seconds precision | Yes | |
| F561 | Full value expressions | Yes | |
| F591 | Derived tables | Yes | |
| F641 | Row and table constructors | Yes | |
| F651 | Catalog name qualifiers | Yes | |
| F846 | Octet support in regular expression operators | Yes | |
| F847 | Nonconstant regular expressions | Yes | |
| F850 | Top-level in | Yes | |
| F851 | in subqueries | Yes | |
| F852 | Top-level in views | Yes | |
| F855 | Nested in | Yes | |
| S023 | Basic structured types | Yes | |
| S091 | Basic array support | Yes | |
| S091-01 | Arrays of built-in data types | Yes | |
| S091-02 | Arrays of distinct types | Yes | |
| S098 | ARRAY_AGG | Partial | collect_list provides similar functionality |
| S201-01 | Array parameters | Yes | |
| S281 | Nested collection types | Yes | |
| S301 | Enhanced UNNEST | Partial | LATERAL JOIN provides similar functionality |
| T021 | BINARY and VARBINARY data types | Partial | BINARY only |
| T031 | BOOLEAN data type | Yes | |
| T051 | Row types | Yes | |
| T071 | BIGINT data type | Yes | |
| T121 | WITH (excluding RECURSIVE) in query expression | Yes | |
| T122 | WITH (excluding RECURSIVE) in subquery | Yes | |
| T171 | LIKE clause in table definition | Yes | |
| T172 | AS subquery clause in table definition | Yes | |
| T281 | SELECT privilege with column granularity | Partial | Provided by ecosystem projects like Apache Ranger and Apache Sentry |
| T326 | Table functions | Yes | |
| T331 | Basic roles | Yes | |
| T351 | Bracketed comments | Yes | |
| T431 | Extended grouping capabilities | Partial | Concatenated grouping sets unsupported |
| T433 | Multiargument GROUPING function | Yes | |
| T441 | ABS and MOD functions | Yes | |
| T501 | Enhanced EXISTS predicate | Yes | |
| T551 | Optional key words for default syntax | Yes | |
| T581 | Regular expression substring function | Yes | |
| T611 | Elementary OLAP operations | Yes | |
| T612 | Advanced OLAP operations | Partial | PERCENT_RANK, CUME_DIST and ROW_NUMBER supported |
| T613 | Sampling | Yes | Nonstandard syntax via TABLESAMPLE |
| T614 | NTILE function | Yes | |
| T615 | LEAD and LAG functions | Yes | |
| T616 | Null treatment option for LEAD and LAG functions | Yes | |
| T617 | FIRST_VALUE and LAST_VALUE functions | Yes | |
| T621 | Enhanced numeric functions | Yes | |
| T631 | IN predicate with one list element | Yes |