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
10.15k stars 2.93k forks source link

set 'iceberg.unique-table-location=true', even though it is set. #18766

Closed dominikhei closed 1 year ago

dominikhei commented 1 year ago

Hello, I get the error:

Cannot create a table on a non-empty location: s3a://sample-lakehouse/raw/user_data/, set 'iceberg.unique-table-location=true' in your Iceberg catalog properties to use unique table locations for every table.

This is the sql statement I am trying to execute:

CREATE SCHEMA iceberg.raw with (LOCATION = 's3a://sample-lakehouse/raw/');
CREATE TABLE iceberg.raw.user_data (
    registration_dttm   timestamp(6),
        id              int,
        first_name      varchar,
        last_name       varchar,
        email           varchar,
        gender          varchar,
        ip_address      varchar,
        cc              varchar,
        country         varchar,
        birthdate       varchar,
        salary          double,
        title           varchar,
        comments        varchar
)
COMMENT 'Table with sample user data'
WITH (
    format = 'PARQUET',
    sorted_by = ARRAY['id'],
    location = 's3a://sample-lakehouse/raw/user_data/'
); 

My iceberg.properties file looks like this:

connector.name=iceberg
iceberg.unique-table-location=true
hive.metastore.uri=thrift://hive-metastore:9083
hive.s3.path-style-access=true
hive.s3.endpoint=http://minio:9000/
hive.s3.aws-access-key=test
hive.s3.aws-secret-key=test12334567

Is there anything I have done wrong?

ebyhr commented 1 year ago

Please remove location table property from CREATE TABLE statement if you want to use unique locations.