How Atlas works with Iceberg
You can use Atlas to find, organize, and manage different aspects of data about your Iceberg tables and how they relate to each other. This enables a range of data stewardship and regulatory compliance use cases.
The Atlas connectors distinguish between Hive and Iceberg tables. The Iceberg table is available in a “typedef” format which implies that the underlying data can be retrieved by querying the Iceberg table. All attributes of the Hive table are available in the Iceberg table and this equivalence is achieved by creating the Iceberg table as a sub-type of the underlying Hive table. Optionally, the Iceberg table can also be queried by Hive or Impala engine. For more information about Iceberg and related concepts, see Apache Iceberg features and Apache Iceberg in CDP.
Both Iceberg and Hive tables have equality in Atlas in terms of data tagging. Data evolution and transformation are features unique to Iceberg tables. Iceberg adds tables to compute engines including Spark, Hive and Impala using a high-performance table format that works just like a SQL table. Also, the lineage support for Iceberg table is available. For example, when a Hive table is converted to Iceberg format, the lineage is displayed for the conversion process in Atlas UI.
- Migration of Hive tables to Iceberg is achieved with the following:
- Using in-place migration by running a Hive query with the ALTER TABLE statement and setting the table properties
- Executing CTAS command from Hive table to the Iceberg table.
Schema evolution allows you to easily change a table's current schema to accommodate data that changes over time. Schema evolution enables you to update the schema that is used to write new data while maintaining backward compatibility with the schemas of your old data. Later the data can be read together assuming all of the data has one schema.
Iceberg tables supports the following schema evolution changes:Add – add a new column to the table or to a nested struct
Drop– remove an existing column from the table or a nested struct
Rename– rename an existing column or field in a nested struct
Update– widen the type of a column, struct field, map key, map value, or list element
Reorder – change the order of columns or fields in a nested struct
Partition specification allows you to initiate queries faster by grouping similar rows together when writing.
As an example, queries for log entries from a
logstable usually include a time range, like the following query for logs between 10 A.M. and 12 A.M.
SELECT level, message FROM logs
WHERE event_time BETWEEN '2018-12-01 10:00:00' AND '2018-12-0112:00:00'
Configuring the logs table to partition by the date of event_time groups log events into files with the same event date. Iceberg keeps track of that date and uses it to skip files for other dates that do not have useful data.
- Partition evolution across Iceberg table partitioning can be updated in an existing table because queries do not reference partition values directly.
When you evolve a partition specification, the old data written with an earlier specification remains unchanged. New data is written using the new specification in a new layout. The metadata for each of the partition versions is stored separately.Due to this nature of partition evolution, when you start writing queries, you get split planning. This is where each partition layout plans files separately using the filter it derives for that specific partition layout.