-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Random improvements #26006
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
Random improvements #26006
Conversation
core/trino-main/src/main/java/io/trino/server/ServerConfig.java
Outdated
Show resolved
Hide resolved
| return getLong(getTpchColumn(field)); | ||
| } | ||
|
|
||
| private long getLong(TpchColumn<E> tpchColumn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was wrong with the existing code here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was redundant
core/trino-main/src/main/java/io/trino/server/ServerConfig.java
Outdated
Show resolved
Hide resolved
8c6bb46 to
41cfe15
Compare
There was a problem hiding this 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 implements several random improvements, including code cleanup and better use of deterministic collection patterns. Key changes include:
- Inlining and refactoring of getter methods in TpchRecordSet.java to remove redundant private methods.
- Simplification of block array size calculation in BlockUtil.java using a clamp helper and removal of unused methods.
- Updating split ordering in SplitAssignment.java to use a sorted collection for deterministic scheduling.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSet.java | Inlined getter methods and changed handling of long values in getTrinoObject. |
| core/trino-spi/src/main/java/io/trino/spi/block/BlockUtil.java | Replaced manual clamping with a clamp helper and removed unused helper methods. |
| core/trino-main/src/main/java/io/trino/execution/SplitAssignment.java | Updated the splits collection to use an immutable sorted set for deterministic ordering. |
Comments suppressed due to low confidence (1)
plugin/trino-tpch/src/main/java/io/trino/plugin/tpch/TpchRecordSet.java:264
- For fields where the expected Java type is long, using 'getInteger(row)' may return an incorrect value or lose precision. Consider verifying that this change is intentional or using a method that returns a long.
return column.getInteger(row);
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: