Abyss-lord opened a new pull request, #5836:
URL: https://github.com/apache/gravitino/pull/5836

   No exception should be thrown when a malformed name is passed to the CLI. 
Currently, passing a malformed name causes an IllegalNamespaceException. I’ve 
added error messages to inform the user when necessary arguments are missing.
   
   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
      Examples:
        - "[#123] feat(operator): support xxx"
        - "[#233] fix: check null before access result in xxx"
        - "[MINOR] refactor: fix typo in variable name"
        - "[MINOR] docs: fix typo in README"
        - "[#255] test: fix flaky test NameOfTheTest"
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. If the PR is unfinished, please mark this PR as draft.
   -->
   
   ### What changes were proposed in this pull request?
   
   No exception should be thrown when a malformed name is passed to the CLI. 
Currently, passing a malformed name causes an IllegalNamespaceException. I’ve 
added error messages to inform the user when necessary arguments are missing.
   
   Additionally, the `FullName.getNamePart()`  method no longer prints error 
messages, as the information it provides is limited. I think performing 
fine-grained argument validation in each method and providing specific hints is 
a better way to hint users.
   
   ### Why are the changes needed?
   
   Fix: #5808 
   
   ### Does this PR introduce _any_ user-facing change?
   
   NO
   
   ### How was this patch tested?
   
   #### Correct example
   `bin/gcli.sh table list -i --metalake demo_metalake --name 
Hive_catalog.default`
   
   <img width="649" alt="image" 
src="https://github.com/user-attachments/assets/9b5f94aa-c630-4e7c-9ee8-44368bc598c2";>
   
   #### Incorrect example
   `bin/gcli.sh table list -i` , **missing metalake, catalog and schema**
   <img width="232" alt="image" 
src="https://github.com/user-attachments/assets/1351837b-8cc9-48a8-916f-0c8204d8b4b8";>
   
   `bin/gcli.sh table list -i --metalake demo_metalake`, **missing catalog and 
schema**
   <img width="424" alt="image" 
src="https://github.com/user-attachments/assets/d0237084-9e8c-4896-b74e-22fe3bda4ce8";>
   
   `bin/gcli.sh table list -i --metalake demo_metalake --name Hive_catalog` , 
**missing schema**
   <img width="591" alt="image" 
src="https://github.com/user-attachments/assets/42004d23-f38c-4766-9bf7-1393c8120248";>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to