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

Use TableInfo instead of TableDescriptor for created table #363

Closed
2 tasks done
wuchong opened this issue Feb 8, 2025 · 0 comments · Fixed by #360
Closed
2 tasks done

Use TableInfo instead of TableDescriptor for created table #363

wuchong opened this issue Feb 8, 2025 · 0 comments · Fixed by #360
Assignees
Milestone

Comments

@wuchong
Copy link
Member

wuchong commented Feb 8, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Currently, many instances rely on TableDescriptor to retrieve table metadata, such as bucket keys, bucket numbers, and primary keys. However, because TableDescriptor is primarily designed for table creation, extracting metadata from it can be cumbersome, as numerous fields are optional. This often leads to lengthy method chains like tableInfo.getTableDescriptor().getTableDistribution().get().getBucketCount().get() just to obtain a bucket number. This approach not only complicates the code but also generates multiple IDE warnings due to forced retrieval from Optionals. It's important to note that once a table is created, it will always have a defined bucket number.

Solution

This issue aims to streamline the process by exclusively using TableInfo to access the metadata of a created table. We will introduce several useful getters to significantly simplify the code, making it more efficient and readable.

Anything else?

No response

Willingness to contribute

  • I'm willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant