Skip to content

Conversation

@pettyjamesm
Copy link
Member

@pettyjamesm pettyjamesm commented Nov 17, 2025

Description

Makes the JDK Vector API extensions (JEP 508) required by Trino at runtime.

Before this change, code in the parquet reader would attempt to discover whether the API was enabled via reflection and gracefully fall back to scalar code when not found at runtime. This worked, but required any SIMD implementations to be kept fully isolated such that SIMD related code would only be loaded at runtime by the JVM if enabled which is onerous to maintain as we add more SIMD logic throughout the engine. Requiring this API to be enabled at runtime allows us to write code that need not use reflection tricks and separate classes to detect and isolate SIMD implementations from scalar code.

Additional context and related issues

Release notes

(x) 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:

## General
* Require the JDK Vector API to be enabled at runtime ({issue}`27340`)

@cla-bot cla-bot bot added the cla-signed label Nov 17, 2025
@github-actions github-actions bot added the docs label Nov 17, 2025
@pettyjamesm pettyjamesm force-pushed the require-vector-api branch 2 times, most recently from f28853c to f6b0d0d Compare November 17, 2025 16:13
@pettyjamesm pettyjamesm marked this pull request as ready for review November 17, 2025 16:13
such as Java 8, Java 11, Java 17, Java 21 or Java 23 do not work.
Newer versions such as Java 25 are not supported -- they may work, but are not tested.

Trino requires enabling the [JDK Vector API extensions](https://openjdk.org/jeps/489) at runtime. Code using
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed. The launcher enables it automatically, so there's nothing for users to do.

Copy link
Member Author

@pettyjamesm pettyjamesm Nov 17, 2025

Choose a reason for hiding this comment

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

Shall I rephrase this to make it clear the launcher already sets that flag, or just remove the section altogether? I've rephrased this section to make it more clear that the launcher sets the flag, but am happy to remove it altogether if you'd prefer.

Copy link
Member

Choose a reason for hiding this comment

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

I would remove it altogether. It's a detail users shouldn't be concerned with -- we handle everything that's needed under the covers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, removed.

Copy link
Member

Choose a reason for hiding this comment

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

I think it is good idea to mention it because we should showcase that we're actually using some cool new Java features. Also, developers launch Trino process without going through trino launcher and the information about adding the vector module as a requirement will avoid some confusion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which developer section should I add a mention of this to?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Will follow up with docs in a subsequent PR. The relevant bits to include in DEVELOPMENT.md might merit some additional discussion that isn't necessary to block this PR on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #27342

@pettyjamesm pettyjamesm force-pushed the require-vector-api branch 3 times, most recently from 8f2fe8e to 2aeb206 Compare November 17, 2025 17:20
@findepi
Copy link
Member

findepi commented Nov 17, 2025

Before this change, code in the parquet reader would attempt to discover whether the API was enabled via reflection and gracefully fall back to scalar code when not found at runtime.

Do you know why it was done so?

@pettyjamesm
Copy link
Member Author

Do you know why it was done so?

Presumably because we wanted to fallback gracefully when the API was not enabled (it's an incubating API, after all)

@wendigo
Copy link
Contributor

wendigo commented Nov 17, 2025

@findepi I think that we assumed at that time, that we don't want to require vector API as we are unsure of its stability. Since then, it proved stable and the only reason this is incubating is its reliance on the Valhalla.

@martint
Copy link
Member

martint commented Nov 17, 2025

It was from the days where we required Java 17 as the minimum version, and before we started tracking the latest JVM version. There was no canonical version to target. So, it was really an optional feature at the time.

Adds a runtime check to ensure the Vector API is enabled on the current
JVM during system startup.
Now that the vector API is a hard requirement, we can avoid probing for
its presence based on reflection.
@pettyjamesm pettyjamesm merged commit 4e8f344 into trinodb:master Nov 17, 2025
196 of 198 checks passed
@pettyjamesm pettyjamesm deleted the require-vector-api branch November 17, 2025 21:05
@github-actions github-actions bot added this to the 479 milestone Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants