Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 180 additions & 117 deletions src/storage/src/sink/iceberg.rs

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions test/iceberg/fenced-writer-setup.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

> CREATE SECRET access_key_secret AS '${arg.s3-access-key}'

> CREATE CONNECTION aws_conn TO AWS (
ACCESS KEY ID = 'tduser',
SECRET ACCESS KEY = SECRET access_key_secret,
ENDPOINT = '${arg.aws-endpoint}',
REGION = 'us-east-1'
);

> CREATE CONNECTION polaris TO ICEBERG CATALOG (
CATALOG TYPE = 'REST',
URL = 'http://polaris:8181/api/catalog',
CREDENTIAL = 'root:root',
WAREHOUSE = 'default_catalog',
SCOPE = 'PRINCIPAL_ROLE:ALL'
);

> CREATE TABLE fence_src (id INT, val TEXT);

> INSERT INTO fence_src VALUES (1, 'a'), (2, 'b'), (3, 'c');

> CREATE SINK fence_sink
FROM fence_src
INTO ICEBERG CATALOG CONNECTION polaris (
NAMESPACE 'default_namespace',
TABLE 'fence_table'
)
USING AWS CONNECTION aws_conn
KEY (id) NOT ENFORCED
MODE UPSERT
WITH (COMMIT INTERVAL '2s');
40 changes: 40 additions & 0 deletions test/iceberg/idempotent-retry-setup.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

> CREATE SECRET access_key_secret AS '${arg.s3-access-key}'

> CREATE CONNECTION aws_conn TO AWS (
ACCESS KEY ID = 'tduser',
SECRET ACCESS KEY = SECRET access_key_secret,
ENDPOINT = '${arg.aws-endpoint}',
REGION = 'us-east-1'
);

> CREATE CONNECTION polaris TO ICEBERG CATALOG (
CATALOG TYPE = 'REST',
URL = 'http://polaris-proxy:8181/api/catalog',
CREDENTIAL = 'root:root',
WAREHOUSE = 'default_catalog',
SCOPE = 'PRINCIPAL_ROLE:ALL'
);

> CREATE TABLE retry_src (id INT, val TEXT);

> INSERT INTO retry_src VALUES (1, 'a'), (2, 'b'), (3, 'c');

> CREATE SINK retry_sink
FROM retry_src
INTO ICEBERG CATALOG CONNECTION polaris (
NAMESPACE 'default_namespace',
TABLE 'retry_table'
)
USING AWS CONNECTION aws_conn
KEY (id) NOT ENFORCED
MODE UPSERT
WITH (COMMIT INTERVAL '2s');
16 changes: 16 additions & 0 deletions test/iceberg/idempotent-retry-verify.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.

$ duckdb-execute name=iceberg
CREATE SECRET s3_secret (TYPE S3, KEY_ID 'tduser', SECRET '${arg.s3-access-key}', ENDPOINT '${arg.aws-endpoint}', URL_STYLE 'path', USE_SSL false, REGION 'minio');
SET unsafe_enable_version_guessing = true;

$ duckdb-query name=iceberg
SELECT COUNT(*) FROM iceberg_scan('s3://test-bucket/default_namespace/retry_table')
13
Loading
Loading