Duczer East
Healthcare

In-perimeter AI on governed clinical and operational data.

Financial Services

Private AI and data platforms built to clear model-risk and audit review.

Financial services

Private AI, KYC/AML, API gateways and data governance for banks.

Insurance

Change data capture, governed agents and integration for insurers.

Healthcare

PHI document intelligence, FHIR APIs and in-perimeter AI for health systems and plans.

GuideCloudera / Data Services & AI7 min read

Hive to Iceberg migration steps on Cloudera: pre-checks, methods, tests and rollback

In waves, with a query test and a way back

Authored byCo-Founder and Managing Partner, Duczer East
Part of the Insights topic: Private AI & Data Architecture
On this page
  1. Pre-checks
  2. Conversion methods
  3. Iceberg format version 1 or 2
  4. What happens to the old table
  5. Speed on big tables
  6. Query tests
  7. Rollback
  8. A wave plan
  9. After the move
  10. A first engagement

Move Hive tables to Iceberg in waves: inventory the tables, choose in-place conversion or rewrite per table, run the same queries before and after, and keep a rollback until the test passes. In-place conversion is quick because it leaves data files as they are; rewriting lets you repartition and fix small files.

Pre-checks

  • List every table with size, file count, format (Parquet, ORC, Avro), partitioning and write pattern.
  • Note the engines and jobs that read or write each table.
  • Check your Cloudera Runtime release for the Iceberg features you need, using the Iceberg feature matrix.
  • Check Ranger policies on each table, because the new table needs the same rules.
  • Agree a rollback and who signs off.

Then screen for the cases Cloudera says in-place migration cannot take:

CheckWhat Cloudera documentsIf it fails
File formatThe source must be Avro, ORC or ParquetRewrite into Iceberg instead
Column typesSome Hive types have no Iceberg equivalent, such as tinyint and smallint. Tables with them are not migratedChange the column type first, or rewrite with a cast
Partition valuesTables partitioned by string columns whose values contain a forward slash cannot be migrated, because of an Apache Iceberg bugClean the values or rewrite
Table kindCloudera's in-place page covers external tablesCheck managed tables separately before you plan them

Conversion methods

MethodHowChoose it whenWatch for
In place (Hive)ALTER TABLE ... SET TBLPROPERTIES with the Iceberg storage handlerData files are healthy and partitioning is fineExisting small files stay small until you compact
In place (Impala)ALTER TABLE ... CONVERT TO ICEBERGYou work from Impala and your release supports itCheck the format-version setting afterwards
In place (Spark)The Iceberg migrate procedure, with snapshot for a trial runYou run Spark and want a backup table keptFails on bucketed tables
RewriteCREATE TABLE ... AS SELECT into a new Iceberg tableYou want new partitioning or sorting, or to fix small filesNeeds extra storage and a cut-over of readers and writers
sql
-- Hive: convert in place
ALTER TABLE sales.orders SET TBLPROPERTIES (
  'storage_handler'='org.apache.iceberg.mr.hive.HiveIcebergStorageHandler');

-- Impala: convert in place
ALTER TABLE sales.orders CONVERT TO ICEBERG;

-- Rewrite into a new table (Impala)
CREATE TABLE sales.orders_ice STORED AS ICEBERG AS SELECT * FROM sales.orders;

The Apache Iceberg Hive documentation says migration of external Avro, Parquet or ORC tables is a separate step from other changes, while a Cloudera example combines them. Follow the Cloudera guide for your release.

Iceberg format version 1 or 2

Cloudera's Impala route converts the table to an Iceberg V1 table, and a second statement sets V2. The Hive route in Cloudera's Data Hub example sets the format version in the same statement as the storage handler.

sql
-- Impala: convert, then move to format version 2
ALTER TABLE sales.orders CONVERT TO ICEBERG;
ALTER TABLE sales.orders SET TBLPROPERTIES ('format-version'='2');

-- Hive: one statement
ALTER TABLE sales.orders SET TBLPROPERTIES (
  'storage_handler'='org.apache.iceberg.mr.hive.HiveIcebergStorageHandler',
  'format-version'='2');

Version 2 is the version that supports row-level deletes, which is why most teams want it. Apache Iceberg has defaulted new tables to version 2 since release 1.4.0.

What happens to the old table

In-place migration regenerates only metadata, and the new metadata points at the existing data files. That is why it is fast. The new Iceberg table takes the old table's name and location. Cloudera gives a hard warning: do not drop, move or change the old table during migration, because doing so can delete the data files that both tables use. The exception it names is setting external.table.purge to FALSE, which makes a drop safe.

With the Spark route, the Iceberg documentation adds that migrate keeps the original table as a backup unless you ask it not to, and that the snapshot procedure creates a trial table that shares the source files. A snapshot table cannot expire snapshots, because that would delete files it does not own.

sql
-- Spark: trial run that leaves the source untouched
CALL catalog_name.system.snapshot('sales.orders', 'sales.orders_trial');

-- Spark: migrate in place, keeping the original as a backup table
CALL catalog_name.system.migrate('sales.orders');

Speed on big tables

For Impala conversions, the NUM_THREADS_FOR_TABLE_MIGRATION query option sets the maximum threads. Cloudera notes that one partition is processed at a time, with threads working across its files, so a table with one file per partition runs one at a time. Many small partitions finish slower than a few large ones.

Query tests

  1. Pick the ten queries that matter most for the table, and record runtime and rows returned.
  2. Run them on the old table, then on the converted table.
  3. Compare results row for row, and compare runtimes and planning time.
  4. Record the table's file count and size before and after.
  5. Run each reader and writer job once against the converted table in a test window.

Rollback

Keep the old table, or a copy of its definition and files, until the test passes and readers have moved. Cut over writers last. If a check fails, repoint readers at the original and investigate. Do not expire snapshots or delete originals until the sign-off.

A wave plan

WaveTablesWhy this order
0One low-risk tableProves the steps, the Ranger rules and the rollback
1Read-mostly reporting tablesFew writers to move, easy to compare results
2Tables with small-file painThe rewrite method pays off most here
3Tables with many writers or streaming inputNeeds the most cut-over planning, so go last

After the move

Compact and expire snapshots on a schedule, using the maintenance runbook. For a worked example see moving Hive tables to Iceberg on Cloudera, and for the platform view see open data lakehouse on Cloudera. If other platforms need these tables later, read the Iceberg REST catalog guide.

A first engagement

Duczer East offers a migration plan: we inventory your tables, screen each against the checks above, pick a method per table, and hand back a wave plan with test queries and a rollback for each wave.

Frequently asked questions

Can Hive tables convert to Iceberg without moving data?

Cloudera documents an in-place migration that sets the Iceberg storage handler on a Hive table, leaving the data files as they are. A rewrite into a new Iceberg table is the alternative.

Can Impala do the migration?

Yes, through ALTER TABLE ... CONVERT TO ICEBERG on current releases. Earlier Cloudera documentation says Impala could not migrate tables, so check your release.

How do we roll back?

Keep the original table or its metadata until the test passes. For an in-place conversion, take a backup of the table definition and a copy of the files you cannot recreate.

Which tables should go first?

Small or slow-changing tables, then large tables with slow metadata operations. Leave static or unused tables alone.

Does in-place migration rewrite the data files?

No. Cloudera states that only metadata is regenerated, and it points at the existing data files, which is why the migration is fast.

Which Hive tables cannot be migrated in place?

Cloudera lists tables that are not Avro, ORC or Parquet, tables with column types that have no Iceberg equivalent such as tinyint and smallint, and tables partitioned by string values containing a forward slash.

What must I avoid doing to the old table?

Do not drop, move or change the old table during migration, because that can delete data files that both tables use. Setting external.table.purge to FALSE makes a drop safe.

Authored by

Co-Founder and Managing Partner, Duczer East

David deBoisblanc is co-founder of Duczer East and a digital transformation and innovation leader in data-centric AI, agentic systems, and enterprise integration. He shapes intent-driven AI solutions that modernize how organizations use data, drawing on deep experience with Cloudera and complex enterprise integration landscapes.

Newsletter

The Practitioner's Briefing

Senior-level insights on agentic AI, data engineering and enterprise integration, delivered to your inbox.

One email when there is something worth reading. Unsubscribe any time.

Let's Talk

Want to discuss the ideas raised here?

Tell us what you are working on. A senior practitioner replies, and only your email is required.

Get a quote