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.
By default, executing a CREATE TABLE statement creates a managed Apache Hive 3 table in the Hive metastore. You can change the default behavior to use the legacy CREATE TABLE behavior. When you configure legacy behavior, CREATE TABLE generates external tables. Legacy behavior is recommended only during upgrading due to the advantages of full ACID transactional tables over external tables.
- Insert
- Update
- Delete
Using ACID-compliant, transactional tables causes no performance or operational overload. Bucketing is not necessary.
If you are a Spark user, switching to legacy behavior is unnecessary. Calling ‘create table’ from SparkSQL, for example, creates an external table after upgrading to CDP as it did before the upgrade.
Configure legacy CREATE TABLE behavior
When you configure legacy behavior, CREATE TABLE
creates an external table in your specified warehouse, which is /warehouse/tablespace/external/hive by default
.
To configure legacy behavior at the session level, you can pass a property to HiveServer (HS2) in
the Beeline connection string when you launch Hive. Alternatively, you can pass the
property on the Hive command line to switch to the old behavior. You can also
configure legacy create table behavior at the site level by configuring properties
in Cloudera Manager. When configured at the site level, legacy behavior persists
from session to session.