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] Missleading error message in Gravitino CLI when missing schema name #5926

Closed
justinmclean opened this issue Dec 20, 2024 · 1 comment · Fixed by #5939
Closed
Assignees
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

justinmclean commented Dec 20, 2024

What would you like to be improved?

Running this command with the playground gcli schema details --metalake metalake_demo --name catalog_postgres -i gives this output:

Malformed entity name.
Invalid string to encode: null

How should we improve?

The output should be something like:

Malformed entity name.
Unknown schema name.
@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Dec 20, 2024
@Abyss-lord
Copy link
Contributor

I would like to work on it.

Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 22, 2024
Fix schema arguments validation just like tableCommands.
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 22, 2024
Add some validation test cases for the schema list command and schema details command.
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 22, 2024
move handling of LIST command "back" to the switch case
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 23, 2024
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 23, 2024
fix test case and revert change of switch/case logic.
@xunliu xunliu closed this as completed in 7a1abf5 Dec 23, 2024
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 23, 2024
…I when missing schema (apache#5939)

### What changes were proposed in this pull request?

Fix schema arguments validation just like table commands. running
command like `gcli schema details --metalake metalake_demo --name
catalog_postgres -I` give Missleading error message as below.

```bash
Malformed entity name.
Invalid string to encode: null
```
It should display a friendly error message.

### Why are the changes needed?

Fix: apache#5926 

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

```bash
bin/gcli.sh schema details --m demo_metalake -i
# output
# Missing --name option.
# Missing --name option.
# Missing required argument(s): catalog, schema

bin/gcli.sh schema details --m demo_metalake --name Hive_catalog -i
# output
# Malformed entity name.
# Missing required argument(s): schema

bin/gcli.sh schema details --m demo_metalake --name Hive_catalog.default -i
# ouput: default,Default Hive database

bin/gcli.sh schema list --m demo_metalake -i
# output:
# Missing --name option.
# Missing required argument(s): catalog

bin/gcli.sh schema list --m demo_metalake -i --name Hive_catalog
# correct output
```
Abyss-lord added a commit to Abyss-lord/gravitino that referenced this issue Dec 29, 2024
…I when missing schema (apache#5939)

### What changes were proposed in this pull request?

Fix schema arguments validation just like table commands. running
command like `gcli schema details --metalake metalake_demo --name
catalog_postgres -I` give Missleading error message as below.

```bash
Malformed entity name.
Invalid string to encode: null
```
It should display a friendly error message.

### Why are the changes needed?

Fix: apache#5926 

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

```bash
bin/gcli.sh schema details --m demo_metalake -i
# output
# Missing --name option.
# Missing --name option.
# Missing required argument(s): catalog, schema

bin/gcli.sh schema details --m demo_metalake --name Hive_catalog -i
# output
# Malformed entity name.
# Missing required argument(s): schema

bin/gcli.sh schema details --m demo_metalake --name Hive_catalog.default -i
# ouput: default,Default Hive database

bin/gcli.sh schema list --m demo_metalake -i
# output:
# Missing --name option.
# Missing required argument(s): catalog

bin/gcli.sh schema list --m demo_metalake -i --name Hive_catalog
# correct output
```
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
2 participants