Apache Iceberg is an open table format for huge analytic datasets. Iceberg adds tables to compute engines including Spark, Trino, PrestoDB, Flink, Hive and Impala using a high-performance table format that works just like a SQL table.

This article assumes that you have mastered the basic knowledge and operation of Iceberg. For the knowledge about Iceberg not mentioned in this article, you can obtain it from its Official Documentation.

By using kyuubi, we can run SQL queries towards Iceberg which is more convenient, easy to understand, and easy to expand than directly using Trino to manipulate Iceberg.

Iceberg Integration

To enable the integration of kyuubi trino sql engine and Iceberg through Catalog APIs, you need to:

Configurations

To activate functionality of Iceberg, we can set the following configurations:

  1. connector.name=iceberg
  2. hive.metastore.uri=thrift://localhost:9083

Iceberg Operations

Taking CREATE TABLE as a example,

  1. CREATE TABLE orders (
  2. orderkey bigint,
  3. orderstatus varchar,
  4. totalprice double,
  5. orderdate date
  6. ) WITH (
  7. format = 'ORC'
  8. );

Taking SELECT as a example,

  1. SELECT * FROM new_orders;

Taking INSERT as a example,

  1. INSERT INTO cities VALUES (1, 'San Francisco');

Taking UPDATE as a example,

  1. UPDATE purchases SET status = 'OVERDUE' WHERE ship_date IS NULL;

Taking DELETE FROM as a example,

  1. DELETE FROM lineitem WHERE shipmode = 'AIR';