Skip to content

Conversation

@chenjian2664
Copy link
Contributor

Description

The variable name ending with builder is misleading—it actually holds a list, not a builder.

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Jun 19, 2025
@github-actions github-actions bot added the hive Hive connector label Jun 19, 2025
@ebyhr
Copy link
Member

ebyhr commented Jun 19, 2025

The variable name ending with builder is misleading—it actually holds a list, not a builder.

I don't think the original name was misleading as the variable is used like a builder.

@chenjian2664
Copy link
Contributor Author

chenjian2664 commented Jun 19, 2025

It confuses me when I look at this line:

 ParquetReader parquetReader = parquetReaderProvider.createParquetReader(parquetColumnFieldsBuilder, appendRowNumberColumn);

I was trying to get to know why the method accept the builder, and then to follow the code to see where does the parquetColumnFieldsBuilder actual calling build method.

@ebyhr
Copy link
Member

ebyhr commented Jun 19, 2025

The new name is misleading in for loop as the value is not finalized there. Builder suffix was helpful to clarify it's a variable holding a middle state. Just adding ImmutableList.copyOf is enough to me.

Previously, `parquetColumnFieldsBuilder` was passed directly to
`createParquetReader`, which was confusing as it looked like a
builder but wasn’t clear where `.build()` was called. Wrapping it
with `ImmutableList.copyOf` makes the intent explicit and avoids the
impression that the method accepts a builder directly.
@ebyhr ebyhr changed the title Rename variable for clarity in ParquetPageSourceFactory Wrapping parquetColumnFieldsBuilder with ImmutableList.copyOf Jun 19, 2025
@ebyhr ebyhr merged commit 2fb5863 into trinodb:master Jun 19, 2025
58 checks passed
@github-actions github-actions bot added this to the 477 milestone Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed hive Hive connector

Development

Successfully merging this pull request may close these issues.

2 participants