Skip to content

Minor improvement for Iceberg S3 Tables#27666

Open
ebyhr wants to merge 4 commits intomasterfrom
ebi/iceberg-s3tables
Open

Minor improvement for Iceberg S3 Tables#27666
ebyhr wants to merge 4 commits intomasterfrom
ebi/iceberg-s3tables

Conversation

@ebyhr
Copy link
Copy Markdown
Member

@ebyhr ebyhr commented Dec 17, 2025

Description

Follow-up of #24994

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Dec 17, 2025
@github-actions github-actions bot added the iceberg Iceberg connector label Dec 17, 2025
@ebyhr ebyhr force-pushed the ebi/iceberg-s3tables branch from 0ccd911 to 0170e05 Compare December 17, 2025 04:28
@ebyhr ebyhr requested a review from findepi December 18, 2025 05:15
{
private IcebergS3TablesQueryRunnerMain() {}

static void main()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

public boolean isS3Tables()
{
String warehouse = restSessionCatalog.properties().get(CatalogProperties.WAREHOUSE_LOCATION);
return warehouse != null && warehouse.startsWith("s3tablescatalog/") && "sigv4".equals(restSessionCatalog.properties().get("rest.auth.type"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth code comment where did s3tablescatalog come from?


private boolean isS3Tables()
{
return catalog instanceof TrinoRestCatalog restCatalog && restCatalog.isS3Tables();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have this new check, do we still need the Locations.isS3Tables check?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name "isS3Tables" is not clear to me, the method is using a catalog to check if it "isS3Tables", I don’t have a strong suggestion for an alternative name though


if (isS3Tables()) {
// S3 Tables throw "Malformed request: Cannot parse missing field: statistics" error when we try to commit extended statistics
return TableStatisticsMetadata.empty();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

statistics is part of Iceberg spec for a while now, it's sad it's not supported by s3tables, because it makes queries inherently less performant on top of these tables. cc @pettyjamesm

Is there a public tracker link for this important and missing functionality?
(i mean AWS's issue, not an issue in Trino)


@Nullable
String defaultTableLocation(ConnectorSession session, SchemaTableName schemaTableName);
Optional<String> defaultTableLocation(ConnectorSession session, SchemaTableName schemaTableName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️


private boolean isS3Tables()
{
return catalog instanceof TrinoRestCatalog restCatalog && restCatalog.isS3Tables();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name "isS3Tables" is not clear to me, the method is using a catalog to check if it "isS3Tables", I don’t have a strong suggestion for an alternative name though

File expectedSchemaDirectory = new File(tmpDirectory.toFile(), namespace + ".db");
File expectedTableDirectory = new File(expectedSchemaDirectory, schemaTableName.getTableName());
assertThat(catalogWithDefaultLocation.defaultTableLocation(SESSION, schemaTableName)).isEqualTo(expectedTableDirectory.toPath().toAbsolutePath().toString());
assertThat(catalogWithDefaultLocation.defaultTableLocation(SESSION, schemaTableName)).contains(expectedTableDirectory.toPath().toAbsolutePath().toString());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think use "hasValue" is more readable for asserting Optional value

@github-actions
Copy link
Copy Markdown

This pull request has gone a while without any activity. Ask for help on #core-dev on Trino slack.

@github-actions github-actions bot added the stale label Jan 12, 2026
@ebyhr ebyhr added stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed. and removed stale labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed iceberg Iceberg connector stale-ignore Use this label on PRs that should be ignored by the stale bot so they are not flagged or closed.

Development

Successfully merging this pull request may close these issues.

3 participants