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

[Improvement] Display index infromation for tables in the Gravitino CLI #5277

Open
justinmclean opened this issue Oct 27, 2024 · 3 comments
Open
Assignees
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

What would you like to be improved?

Have a command to display index information for Tables.

How should we improve?

This can be done by:

  • Adding a new CLI command to display index information by calling index on the Table object.
  • Adding a new command option --index
  • Adding the command to GravitinoCommandLine
  • Updating user documentation
@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Oct 27, 2024
@justinmclean justinmclean changed the title [Improvement] Display index infromation for table in the Gravitino CLI [Improvement] Display index infromation for tables in the Gravitino CLI Oct 27, 2024
@lsyulong
Copy link
Contributor

I want to try it, but I don't know how to modify it. Can you help me

@justinmclean
Copy link
Member Author

Thanks for offering to help.

To get started on this, have a look at the commands in clients/cli/src/main/java/org/apache/gravitino/cli/commands/, ListColumns.java would be a good one to copy, create a new command called sayListIndexes.java. It would call the index() method from loadTable() to get information about the table's indexes, and print out the name and type of each index.
Next, add an index option to GravitinnoOptions.java and modify handleTableCommand in GravitionoCommandLine.java to create the new command when passed the new option and the details command. Compile and test the command with the Gravitino playground. I would expect the command to be like this:
gcli table details --metalake metalake_demo --name catalog_postgres.hr.salaries --index
Finally, update the documentation in docs/cli.md adding the command to it.

@justinmclean
Copy link
Member Author

@lsyulong do you want to work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

No branches or pull requests

2 participants