Skip to content

Remove dependency on airlift units from client #25772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented May 12, 2025

Description

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label May 12, 2025
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label May 12, 2025
@wendigo wendigo force-pushed the serafin/airlift-jdbc branch from 93c68ad to 14133ec Compare May 12, 2025 13:25
Since client libraries were moved to JDK 11 it's now possible
to use java.time.Duration instead of Airlift's Duration class.

Tests are now adjusted to the fact that the smallest duration unit
is nanosecond (which is the smallest "measurable" unit in Java anyway).

This means that 1B and 1ns are smallest units.
@martint
Copy link
Member

martint commented May 12, 2025

What's the purpose of this change? It just seems to make things more complicated.

@wendigo
Copy link
Contributor Author

wendigo commented May 12, 2025

@martint we have long-standing issue with a mixed dependency versions and pinning. This removes this problem.

@wendigo wendigo force-pushed the serafin/airlift-jdbc branch from 14133ec to 3f8aa0a Compare May 12, 2025 14:09
@martint
Copy link
Member

martint commented May 12, 2025

What's the issue? It's the first time I hear about it and haven't seen any PRs or builds fail due to that.

@wendigo
Copy link
Contributor Author

wendigo commented May 12, 2025

@martint trino-jdbc pulls in old version of units while trino-main depends on the newer one. In the trino-jdbc tests, when you want to bring TestingTrinoServer up with some additional catalog configuration that depends on the Duration or DataSize being in a newer version, this will fail.

@wendigo
Copy link
Contributor Author

wendigo commented May 12, 2025

We don't need units in the client to make it work. So removing it, removes this dependency mess

@martint
Copy link
Member

martint commented May 12, 2025

There's a more fundamental problem. trino-jdbc and trino-client target Java 11, but TestingTrinoServer is in trino-main, which is built with Java 24. Any transitive dependencies in trino-main (via TrinoTestingServer) that are incompatible with Java 11 will cause similar problems. At a minimum, they may cause trino-jdbc/trino-client to run tests with a dependency that doesn't match the dependency that's actually bundled in the package during final build.

@wendigo
Copy link
Contributor Author

wendigo commented May 12, 2025

@martint yes but since we keep versions in sync across modules (except for units) we are sure that jdbc uses dependencies supporting JDK11+

@martint
Copy link
Member

martint commented May 12, 2025

That's not guaranteed. If we need to bump a dependency in trino-main, we'll do that, even if that dependency is not compatible with Java 11.

@wendigo
Copy link
Contributor Author

wendigo commented May 12, 2025

@martint I understand but we are not in this situation right now except for airlift:units which I'm trying to remove in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

2 participants