Skip to content

Conversation

@wendigo
Copy link
Contributor

@wendigo wendigo commented Jun 13, 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 Jun 13, 2025
return getLong(getTpchColumn(field));
}

private long getLong(TpchColumn<E> tpchColumn)
Copy link
Member

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was redundant

@wendigo wendigo force-pushed the serafin/random-improvements branch from 8c6bb46 to 41cfe15 Compare June 13, 2025 13:43
@wendigo wendigo requested a review from raunaqmorarka June 13, 2025 13:44
@raunaqmorarka raunaqmorarka requested a review from Copilot June 13, 2025 14:09
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 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);

@wendigo wendigo merged commit 0dddb07 into master Jun 13, 2025
101 of 104 checks passed
@wendigo wendigo deleted the serafin/random-improvements branch June 13, 2025 16:17
@github-actions github-actions bot added this to the 477 milestone Jun 13, 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.

4 participants