Skip to main content

Apache Iceberg Quickstart with SQL

Apache Iceberg Limitations

The following limitations apply when writing to tables in the Apache Iceberg table format:

  • Tables created directly in the Apache Iceberg format will not appear in the Onehouse console.
  • You cannot run Onehouse-managed table services on tables created directly in the Apache Iceberg format.
  • You cannot write to a table in multiple formats -- all writers must use the same table format. However, you can use OneTable catalog sync to enable for read-compatibility across formats.
  • See additional limitations for your Iceberg REST Catalog:
tip

You can avoid these limitations by writing data in Apache Hudi and syncing the table to Apache Iceberg with OneTable catalog sync. See the Apache Hudi SQL quickstart.

Prerequisites

Step 1: Create a Cluster

  1. In the Onehouse console, open Clusters and click Create Cluster.
  2. Configure your Cluster:
    1. Select SQL as the Cluster type.
    2. For the catalog, select the Iceberg REST catalog you added.
    3. Create the Cluster with any other configurations you'd like.

Step 2: Connect a SQL Client

You will need to connect to the SQL Cluster from within your VPC.

  1. Connect a SQL client such as DbVisualizer or beeline, or follow the bastion host connection instructions to use another SQL client.

Step 3: Create an Apache Iceberg Table

Create an Apache Iceberg table

CREATE TABLE nyc.taxis
(
vendor_id bigint,
trip_id bigint,
trip_distance float,
fare_amount double,
store_and_fwd_flag string
)
PARTITIONED BY (vendor_id);
tip

If you don't specify a location for the table, it will be created in the default location defined in your catalog.

Insert records

INSERT INTO nyc.taxis
VALUES (1, 1000371, 1.8, 15.32, 'N'), (2, 1000372, 2.5, 22.15, 'N'), (2, 1000373, 0.9, 9.01, 'N'), (1, 1000374, 8.4, 42.13, 'Y');

Read from the table

SELECT * FROM nyc.taxis;

(Optional) Step 4: Connect External Engines

Connect external query engines to your Iceberg REST catalog to read and write Apache Iceberg tables concurrently with Onehouse.