Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 23, 2026

Rationale for this change

The TODO comment in vector_array_sort.cc asking whether DictionaryArray::dictionary() and DictionaryArray::indices() should return const& has been obsolete.

It was added in commit 6ceb12f when dictionary array sorting was implemented. At that time, these methods returned std::shared_ptr<Array> by value, causing unnecessary copies.

The issue was fixed in commit 95a8bfb which changed both methods to return const std::shared_ptr<Array>&, removing the copies. However, the TODO comment was left unremoved.

What changes are included in this PR?

Removed the outdated TODO comment that referenced GH-35437.

Are these changes tested?

I did not test.

Are there any user-facing changes?

No.

@github-actions
Copy link

⚠️ GitHub issue #35437 has been automatically assigned in GitHub to PR creator.

const auto& dict_array = checked_cast<const DictionaryArray&>(array);
// TODO: These methods should probably return a const&? They seem capable.
// https://github.com/apache/arrow/issues/35437
auto dict_values = dict_array.dictionary();
Copy link
Member Author

Choose a reason for hiding this comment

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

probably can be const auto but let me don't mix it with the current issue.

@github-actions github-actions bot added Component: C++ awaiting review Awaiting review awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant