Skip to content

[#9894] feat (trino-connector): Add the version segment module to support Trino 440-445#9895

Open
diqiu50 wants to merge 6 commits intoapache:branch-trino-smvfrom
diqiu50:tv-03
Open

[#9894] feat (trino-connector): Add the version segment module to support Trino 440-445#9895
diqiu50 wants to merge 6 commits intoapache:branch-trino-smvfrom
diqiu50:tv-03

Conversation

@diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented Feb 5, 2026

What changes were proposed in this pull request?

Add the version segment module for 440-445 to support Trino 440 through Trino 445

Why are the changes needed?

Fix: #9894

Does this PR introduce any user-facing change?

NO

How was this patch tested?

UT and IT

diqiu50 and others added 3 commits February 5, 2026 16:44
…version management

- Add new trino-connector-440-445 module supporting Trino versions 440-445
- Implement version-specific adapters (GravitinoPlugin440, GravitinoConnectorFactory440, etc.)
- Fix GravitinoMetadata440.beginMerge() to wrap return value as GravitinoMergeTableHandle
- Update finishInsert() signature to include sourceTableHandles parameter (Trino 440+ API change)
- Fix SPI configuration file path to META-INF/services/io.trino.spi.Plugin
- Add complete distribution tasks (assembleTrinoConnector, checksumTrinoConnector)

Version management optimization:
- Simplify version validation logic using minTrinoVersion and maxTrinoVersion
- Remove dependency on global minSupportedTrinoVersion property
- Each module now independently manages its version range
- Improve error messages with clear version range information
- Apply optimization to both 435-439 and 440-445 modules

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix typo: createGravitinoPulgin -> createGravitinoPlugin
- Ensures test methods correctly override parent class methods

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change addColumn method to throw TrinoException directly instead of wrapping in RuntimeException
- Properly propagate TrinoException from reflection invocation
- Add throws declaration to method signature

This fix resolves test failures where TrinoException was being wrapped unnecessarily.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 5, 2026 09:51
Copy link
Contributor

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 adds support for Trino versions 440-445 by creating a new version segment module trino-connector-440-445. The implementation follows the established pattern used in the existing trino-connector-435-439 module.

Changes:

  • Created new module trino-connector-440-445 with version-specific connector implementations for Trino 440-445
  • Updated build configuration for the trino-connector-435-439 module to improve clarity
  • Fixed exception handling in GravitinoMockServer.java to properly re-throw TrinoException instead of wrapping it

Reviewed changes

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

Show a summary per file
File Description
settings.gradle.kts Added new trino-connector-440-445 module to the project
trino-connector/trino-connector-435-439/build.gradle.kts Refactored version range validation for consistency with the new 440-445 module
trino-connector/trino-connector-440-445/build.gradle.kts New build configuration for Trino 440-445 support, consistent with 435-439 module
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoPlugin440.java Entry point plugin class for Trino 440-445
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoConnectorFactory440.java Factory class that creates connectors for Trino versions 440-445
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoConnector440.java Main connector implementation with version-specific metadata and split manager
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoMetadata440.java Metadata adapter implementing Trino 440+ API changes (e.g., finishInsert with sourceTableHandles parameter)
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoSplitManager440.java Split manager implementation with version-specific getInfo() override
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoSystemConnector440.java System connector for internal Gravitino tables and procedures
trino-connector/trino-connector-440-445/src/main/java/org/apache/gravitino/trino/connector/GravitinoNodePartitioningProvider440.java Node partitioning provider for distributed query execution
trino-connector/trino-connector-440-445/src/main/resources/META-INF/services/io.trino.spi.Plugin SPI service registration for GravitinoPlugin440
trino-connector/trino-connector-440-445/src/test/java/TestGravitinoConnector440.java Test class extending base connector tests for Trino 440
trino-connector/trino-connector/src/test/java/org/apache/gravitino/trino/connector/GravitinoMockServer.java Improved exception handling to properly re-throw TrinoException


private void addColumn(
ConnectorMetadata metadata, ConnectorTableHandle tableHandle, ColumnMetadata columnMetadata) {
ConnectorMetadata metadata, ConnectorTableHandle tableHandle, ColumnMetadata columnMetadata) throws TrinoException{
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

Missing space before opening brace. According to Google Java Style Guide, there should be a space between the closing parenthesis and the opening brace of the throws clause.

Suggested change
ConnectorMetadata metadata, ConnectorTableHandle tableHandle, ColumnMetadata columnMetadata) throws TrinoException{
ConnectorMetadata metadata, ConnectorTableHandle tableHandle, ColumnMetadata columnMetadata) throws TrinoException {

Copilot uses AI. Check for mistakes.
diqiu50 and others added 2 commits February 5, 2026 18:10
- Add connectionTimeout and socketTimeout configuration (300 seconds)
- Fixes CI failures when downloading Java 24 toolchain from Foojay API
- Resolves SocketTimeoutException in GitHub Actions environment
Apply Spotless formatting to improve code readability by splitting
long method signature across multiple lines.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Contributor

@yuqi1129 yuqi1129 left a comment

Choose a reason for hiding this comment

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

Another point is that Is poissble to add some tests for Trino 440 to 445.


trino:
image: trinodb/trino:${TRINO_VERSION:-435}
image: trinodb/trino:${TRINO_VERSION:-440}
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we support multiple versions since you changed it from 435 to 440? will you change it again when you support Trino 446 to 450.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants