Skip to content

b8heng/trino-iceberg-rest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Trino and Iceberg REST Catalog Demo

Start containers

docker compose up -d

This will initialize iceberg catalog in Trino.

Initialize test schema

There is a simple SQL script to initialize a test schema in the iceberg catalog by copying TPCH "tiny" schema from the Trino:

docker exec -it trino trino -f /home/trino/test-schema.sql

This is not required. It is possible to create other schemata in the iceberg catalog and create and populate tables there in any way.

Running queries

Connect to Trino CLI and execute queries:

docker exec -it trino trino

Inspect warehouse bucket contents: open Minio Admin panel (user name: admin password: password).

SHOW SCHEMAS from iceberg;
SHOW TABLES from iceberg.test;
select * from iceberg.test.customer;
CREATE SCHEMA iceberg.demo;
CREATE TABLE iceberg.demo.taxis (
  vendor_id bigint,
  trip_id bigint,
  trip_distance real,
  fare_amount double,
  store_and_fwd_flag varchar
)
WITH (
  partitioning = ARRAY['vendor_id']
);
INSERT INTO iceberg.demo.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');
SELECT * FROM iceberg.demo.taxis;

About

Trino with Iceberg REST catalog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published