Skip to content

Conversation

@snuyanzin
Copy link
Contributor

Purpose

It is a small optimization to avoid calling RowType#getFieldNames inside a loop since each time it should through fields and create a new collection of names

Brief change log

Tests

API and Format

Documentation

pojoNames, fieldNames));
}
for (int i = 0; i < tableSchema.getFieldCount(); i++) {
String name = tableSchema.getFieldNames().get(i);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Avoid calling it inside a loop since each call generates a new collection

public List<String> getFieldNames() {
return fields.stream().map(DataField::getName).collect(Collectors.toList());
}

@snuyanzin
Copy link
Contributor Author

fyi @polyzos

@polyzos polyzos merged commit 69d03e1 into apache:main Nov 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants