Handling Semantic and Syntax Changes
You need to perform a number of migration-related changes due to semantic changes
between previous versions of Hive running in CDH or HDP and Hive 3 in CDP. A couple of
syntax changes in Hive 3, related to db.table references and DROP CASCADE, might require
changes to your applications.
Casting Timestamps Results of applications that cast numerics to timestamps differ from Hive 2 to Hive 3. Apache Hive changed the behavior of CAST to comply with the SQL Standard, which does not associate a time zone with the TIMESTAMP type. Checking Compatibility of Column Changes A default configuration change can cause applications that change column types to fail. Correcting `db.table` in Queries For ANSI SQL compliance, Hive 3.x rejects `db.table` in SQL queries. A dot (.) is not allowed in table names. Creating a Table To improve useability and functionality, Hive 3 significantly changed table creation. Configuring legacy CREATE TABLE behavior After you upgrade to CDP and migrate old tables, you might want to briefly switch to Hive legacy behavior. Legacy behavior might solve compatibility problems with your scripts during data migration, for example, when running ETL. Handling the Keyword APPLICATION If you use the keyword APPLICATION in your queries, you might need to modify the queries to prevent failure. Disabling Partition Type Checking An enhancement in Hive 3 checks the types of partitions. This feature can be disabled by setting a property. For more information, see the ASF Apache Hive Language Manual. Dropping Partitions The OFFLINE and NO_DROP keywords in the CASCADE clause for dropping partitions causes performance problems and is no longer supported. Handling Output of greatest and least Functions Renaming Tables To harden the system, Hive data can be stored in HDFS encryption zones. RENAME has been changed to prevent moving a table outside the same encryption zone or into a no-encryption zone.