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. Creating a Table To improve useability and functionality, Hive 3 significantly changed table creation. 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. Add Backticks to Table References CDP includes the Hive-16907 bug fix, which rejects `db.table` in SQL queries. A dot (.) is not allowed in table names. You need to change queries that use such references to prevent Hive from interpreting the entire db.table string as the table name. 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. Granting Permissions to Roles In CDH, the ROLE/GROUP semantics are different from those semantics in CDP. Hive 3 requires a tightly controlled file system and computer memory resources, replacing flexible boundaries that earlier Hive versions allowed. 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.