Skip to content
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

[core] Sort some system table query result #4306

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

askwang
Copy link
Contributor

@askwang askwang commented Oct 10, 2024

Purpose

Sort some system table query result, including tags/partitions/buckets tables.

Tests

API and Format

Documentation

@wwj6591812
Copy link
Contributor

Good, I think no problem, but ut failed.
@askwang

@askwang
Copy link
Contributor Author

askwang commented Oct 10, 2024

Good, I think no problem, but ut failed. @askwang

fixed, thanks. personal repository ut is success

new TreeMap<>(
Comparator.comparing((Pair<String, Integer> o) -> o.getLeft())
.thenComparing(Pair::getRight));
buckets.forEach(
Copy link
Contributor

Choose a reason for hiding this comment

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

Function<BucketEntry, String> toPartString = e -> Arrays.toString(converter.convert(e.partition()));
buckets.sort(Comparator.comparing(toPartString).thenComparing(BucketEntry::bucket));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A little difference, change List<BucketEntry> buckets to List<Pair<String, BucketEntry>> bucketList, to avoid converter.convert(e.partition()) compute twice.

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit c41d23c into apache:master Oct 11, 2024
10 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.

3 participants