Skip to content

Conversation

@electrum
Copy link
Member

@electrum electrum commented Aug 20, 2025

Release notes

(x) Release notes are required, with the following suggested text:

## SPI
* Change the signature of `ConnectorMetadata.beginRefreshMaterializedView()` and 
  `ConnectorMetadata.finishRefreshMaterializedView()`. Table handles for other
  catalogs are no longer passed to these methods. ({issue}`26454`)

@electrum electrum requested review from Copilot and dain August 20, 2025 18:52
@cla-bot cla-bot bot added the cla-signed label Aug 20, 2025
@github-actions github-actions bot added the iceberg Iceberg connector label Aug 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the materialized view refresh SPI to remove foreign table handles from the connector interface. Instead of passing table handles from other catalogs, the new API provides boolean flags indicating whether foreign sources exist.

  • Replace foreign table handle parameters with boolean flags in beginRefreshMaterializedView() and finishRefreshMaterializedView()
  • Filter out foreign table handles in MetadataManager and pass only same-catalog handles to connectors
  • Remove CatalogHandle dependency from IcebergTableHandle and related components

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java Updates SPI method signatures to use boolean flags instead of foreign handles
core/trino-main/src/main/java/io/trino/metadata/MetadataManager.java Filters source table handles by catalog and computes boolean flags
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java Updates method signatures and logic to use boolean flags
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergTableHandle.java Removes CatalogHandle field and related methods
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadataFactory.java Removes CatalogHandle injection
Multiple test files Updates test code to remove CatalogHandle parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@electrum electrum force-pushed the electrum/mviewrefresh branch from af5756f to bcc6b2e Compare August 20, 2025 18:53
Copy link
Member

@dain dain left a comment

Choose a reason for hiding this comment

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

looks good

computedStatistics,
sourceTableHandles,
sourceTableFunctions);
public Optional<ConnectorOutputMetadata> finishRefreshMaterializedView(ConnectorSession session, ConnectorTableHandle tableHandle, ConnectorInsertTableHandle insertHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics, List<ConnectorTableHandle> sourceTableHandles, boolean hasForeignSourceTables, boolean hasSourceTableFunctions)
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this chopped down as there are so many args.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't do that in any of these forwarding classes since the parameter names aren't important to read

Comment on lines +819 to +821
boolean hasForeignSourceTables,
RetryMode retryMode,
RefreshType refreshType)
Copy link
Member

Choose a reason for hiding this comment

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

Consider combining hasForeighSourceTable and RefreshType.

@electrum electrum force-pushed the electrum/mviewrefresh branch from bcc6b2e to 0efb9fc Compare August 20, 2025 19:31
@electrum electrum force-pushed the electrum/mviewrefresh branch from 0efb9fc to a4c379d Compare August 20, 2025 19:32
@electrum electrum merged commit 1bb81b5 into master Aug 20, 2025
302 of 308 checks passed
@electrum electrum deleted the electrum/mviewrefresh branch August 20, 2025 22:40
@github-actions github-actions bot added this to the 477 milestone Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed iceberg Iceberg connector

Development

Successfully merging this pull request may close these issues.

3 participants