trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
9.92k stars 2.86k forks source link

Add support for Unity catalog in Iceberg connector #22609

Open soumilshah1995 opened 1 week ago

soumilshah1995 commented 1 week ago

Start Unity Catalog (UC) server:

bin/start-uc-server

bin/uc table list --catalog unity --schema default

┌────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┬────────────────┐
│    NAME    │  CATALOG_NAME  │  SCHEMA_NAME   │   TABLE_TYPE   │DATA_SOURCE_FORM│    COLUMNS     │STORAGE_LOCATION│    COMMENT     │   PROPERTIES   │   CREATED_AT   │   UPDATED_AT   │    TABLE_ID    │
├────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┤
│hudi_table  │unity           │default         │EXTERNAL        │DELTA           │[]              │s3://soumilsh...│null            │{}              │1720212320756   │1720212320756   │2b381c29-01fb...│
├────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┼────────────────┤
│numbers     │unity           │default         │EXTERNAL        │DELTA           │[]              │file:///Users...│null            │{}              │1720097124777   │1720097124777   │6dd0814f-5831...│
└────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┴────────────────┘

Configure Docker Compose:

version: "3"
services:
  trino-coordinator:
    image: 'trinodb/trino:latest'
    hostname: trino-coordinator
    ports:
      - '9000:9000'
    volumes:
      - ./trino/etc:/etc/trino

Screenshot 2024-07-07 at 9 29 39 AM

Setup SSH tunneling:

ssh -R 8080:localhost:8080 abc.serveo.net

iceberg.properties

connector.name=iceberg
iceberg.catalog.type=rest
iceberg.rest-catalog.uri=http://abc.serveo.net:8080/api/2.1/unity-catalog/iceberg
iceberg.rest-catalog.security=OAUTH2
iceberg.rest-catalog.oauth2.token=not_used

Execute into Trino container and connect:

trino --server localhost:9000 --catalog iceberg --schema default

image

SHOW TABLES FROM unity;

Query 20240707_132801_00006_qqd25, FAILED, 1 node
Splits: 19 total, 0 done (0.00%)
0.52 [0 rows, 0B] [0 rows/s, 0B/s]

Query 20240707_132801_00006_qqd25 failed: Error listing tables for catalog iceberg: Failed to list tables from namespace: unity

Expected Behavior

The tables registered in Unity Catalog should be listed successfully in Trino when querying SHOW TABLES FROM unity;.

Additional Information

Unity Catalog is running at http://abc.serveo.net:8080/. Followed the documentation provided at: Unity Catalog Trino Integration Guide.

ebyhr commented 1 week ago

cc: @cwsteinbach @findinpath

mosabua commented 1 week ago

also cc @alexjo2144

alexjo2144 commented 1 week ago

Do you have a full stack trace?

soumilshah1995 commented 1 week ago

This is all I have I have provided detailed steps to repoduce this behavior

ebyhr commented 1 week ago

@soumilshah1995 You can use --debug CLI option to get a full stack trace.