-
Notifications
You must be signed in to change notification settings - Fork 406
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
[FEATURE] Support table format output for Audit command #5746
Comments
i would like to work on it. could you plz give me two tasks? |
Hi @Abyss-lord, sure you can work on it. |
May I have your email, I have some to discuss. |
It would be best to keep the conversation here, as that aligns with ASF values of openness and transparency. |
Hi @Abyss-lord, We can discuss here. Or I see you are in opensource4you Slack channel, If you have something to discuss, my ID is Chia-Ying Lee. You can dm me. |
I have a idea that we should standardize the output handling by consolidating all output methods at the Command layer. like this https://files.slack.com/files-pri/T05DWGA9CBT-F08D9SNQVPU/image.png public void printInformation(String message) {
if (context.quiet()) {
return;
}
printResult(message);
}
protected <T> void printResults(T entity) {
if (outputFormat == null) {
PlainFormat.output(entity);
return;
}
if (outputFormat.equals(OUTPUT_FORMAT_TABLE)) {
TableFormat.output(entity);
} else if (outputFormat.equals(OUTPUT_FORMAT_PLAIN)) {
PlainFormat.output(entity);
} else {
throw new IllegalArgumentException("Unsupported output format");
}
}
protected void printResults(String message) {
PlainFormat.output(message);
} This way, each subclass only needs to change the |
Hi @Abyss-lord, I cannot see the image you attached (https://files.slack.com/files-pri/T05DWGA9CBT-F08D9SNQVPU/image.png). I think I don't have permission to view the channel at Datastrato Community. Could you attach again? |
|
Hi @Abyss-lord, That sounds like a great idea! Feel free to modify the original output structure as needed. |
…mand Support table format output for Audit command.
…mand format the code.
I use plantuml to create diagram, vs code + plantuml |
…mand Add Table format.
…mand Support table format output for Audit command.
…mand fix some bugs.
Support table format output for Audit command.
Support table format output for Audit command.
### What changes were proposed in this pull request? Support table format output for Audit command. ### Why are the changes needed? Fix: #5746 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? local test. ```bash gcli metalake details --output table -m demo_metalake --audit -i +-----------+--------------------------+-----------+--------------------------+ | Creator | Creation at | Modifier | Modified at | +-----------+--------------------------+-----------+--------------------------+ | anonymous | 2024-12-04T07:41:18.512Z | anonymous | 2025-01-14T07:56:25.496Z | +-----------+--------------------------+-----------+--------------------------+ gcli catalog details --name Hive_catalog -i --output table -m demo_metalake --audit +-----------+--------------------------+-----------+-----------------------------+ | Creator | Creation at | Modifier | Modified at | +-----------+--------------------------+-----------+-----------------------------+ | anonymous | 2024-12-05T01:20:40.512Z | anonymous | 2025-02-21T08:36:50.613886Z | +-----------+--------------------------+-----------+-----------------------------+ gcli schema details --name Hive_catalog.default --output table -m demo_metalake --audit -i +---------+-------------+----------+-------------+ | Creator | Creation at | Modifier | Modified at | +---------+-------------+----------+-------------+ | public | N/A | N/A | N/A | +---------+-------------+----------+-------------+ gcli table details --name Hive_catalog.default.test_dates --output table -m demo_metalake --audit -i +-----------+----------------------+----------+-------------+ | Creator | Creation at | Modifier | Modified at | +-----------+----------------------+----------+-------------+ | panchenxi | 2024-07-24T07:20:52Z | N/A | N/A | +-----------+----------------------+----------+-------------+ ```
Describe the feature
The current Audit command in the Gravitino CLI supports only plain format output.
I plan to add support for table format output to the
MetalakeAudit
,CatalogAudit
,SchemaAudit
andTableAudit
commands.Motivation
No response
Describe the solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: