Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi merged PR #5117: URL: https://github.com/apache/gravitino/pull/5117 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1831006410 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: Cool, looks good to me. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1831005870
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
I see, now there is no duplication.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1828515920
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
I've reviewed and changed the options that were left so there are no
duplicates.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on PR #5117: URL: https://github.com/apache/gravitino/pull/5117#issuecomment-2455910539 @jerryshao @shaofengshi All changes have been made can you please review them again. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1828515920
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
I've reviewed and changed the options that were left so their are no
duplicates.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1828515481 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: OK Done. I've removed the multiple create catalog commands and added a "--properties" option to specify a list of key-value pairs to set the properties. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1828430997
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
Given the other discussion about removing the named catalog creation
options, this is no longer an issue.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1827858498
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
I think it is confusing that a name has ambiguity. "short options are
generally not used" this is not a good reason, otherwise why we support it.
Name conflict is strange, the user don't know what's the behavior; At lease we
can use lower-case and upper-case to differenciate them. I'm not expert on
this, but that's my concern, unless you can point to me that other CLI (like
linux command) also has such duplicated names...
BTW, please don't mark it resolved quickly before the reviewer see the
comment it. Thanks.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1827834747 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: I agree with Jerry that it should be more extensible, so that when adding a new catalog, or adding more property we don't need to update the CLI code to support that. This is important, we should do that in the first version. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1827834747 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: I agree with Jerry that it should be more extensible, so then when adding a new catalog, or adding more property it doesn't need to update the CLI code to support that. This is important, we should do that in the first version. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1827844211 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: OK, I'm fine with it. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1827837926 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password ``` ## Commands -The following commands are available for entity management: +The following commands are used for entity management: - list: List available entities - details: Show detailed information about an entity - create: Create a new entity - delete: Delete an existing entity - update: Update an existing entity +- set: Set an entities property Review Comment: OK, thanks for the confirmation; It ups to you, I'm fine with both. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
jerryshao commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825676264 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: There are two concerns I can see using per-catalog specific arguments: 1. It needs to define lots of arguments for all the catalogs, as the supported catalog number increases, we need to manually add more arguments, which increases the maintenance burden. Besides, in your implementation, you have one `CreateXXXCatalog` for each catalog, so when we add a new catalog, then we also have to update the CLI code, which is not necessary for REST API and Java client, and also increase the maintenance overhead. 2. The specific parameter defined here is also not easy for user to understand without checking the docs. For example, like "--password", the user doesn't know which catalog should use this parameter, he still needs to check the doc, it is because you didn't categorize the parameter for each specific catalog, and there're lots of arguments for different catalogs. So I think it is not necessary to define so many per-catalog arguments, WDYT? @shaofengshi For the problem you mentioned about the limitation of CLI library, I'm not sure if there's different solutions to solve it. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825255686 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I didn't use "set-property" or similar as they are too long, and could be confusing with a hyphen in them, and "--property" gives the context. Tags are handled in a different PR and also use "set" and "remove" but with "--tag". I don't think we need to change anything here. Think of it as saying this: For this type of entity I will "set" a "--property" to this "--value". -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825260164 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: The Apache CLI library doesn't support specifying parameters multiple times so we could not use the form "--property xxx --property yyy". We could support the form "--properties a=b,c=d" but I suggest we do that in another PR. For the user to be able to create a catalog quickly, it makes more sense to have the basic properties specified as named options, this way they don't need to look up the documentation or the REST spec to know exactly what properties need to be set. This makes it easier for the user. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825272078
##
clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java:
##
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli;
+
+import java.util.HashSet;
+import org.apache.gravitino.Catalog;
+
+/**
+ * The {@code CommandEntities} class defines a set of standard entities that
can be used in the
+ * Gravitino CLI. It also can validate if a given entity is a valid entity.
+ */
+public class Providers {
+ public static final String HIVE = "hive";
+ public static final String HADOOP = "hadoop";
+ public static final String ICEBERG = "iceberg";
+ public static final String MYSQL = "mysql";
+ public static final String POSTGRES = "postgres";
+ public static final String KAFKA = "kafka";
+
+ private static final HashSet VALID_PROVIDERS = new HashSet<>();
+
+ static {
+VALID_PROVIDERS.add(HIVE);
+VALID_PROVIDERS.add(HADOOP);
+VALID_PROVIDERS.add(ICEBERG);
+VALID_PROVIDERS.add(MYSQL);
+VALID_PROVIDERS.add(POSTGRES);
+VALID_PROVIDERS.add(KAFKA);
+ }
+
+ /**
+ * Checks if a given provider is a valid provider.
+ *
+ * @param provider The provider to check.
+ * @return true if the provider is valid, false otherwise.
+ */
+ public static boolean isValidProvider(String provider) {
+return VALID_PROVIDERS.contains(provider);
+ }
+
+ public static String internal(String provider) {
+switch (provider) {
+ case HIVE:
+return "hive";
+ case HADOOP:
+return "hadoop";
+ case MYSQL:
+return "jdbc-mysql";
+ case POSTGRES:
+return "jdbc-postgresql";
+ case ICEBERG:
+return "lakehouse-iceberg";
+ case KAFKA:
+return "kafka";
+}
+
+return null;
Review Comment:
Done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825255686 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I didn't use set-property"set-property" or similar as they are too long, and could be confusing with a hyphen in them, and "--property" gives the context. Tags are handled in a different PR and also use set and remove but with "--tag". I don't think we need to change anything here. Think of it as saying this: For this type of entity I will "set" a "--property" to this "--value". -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825255686 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I didn't use set-property"set-property" or similar as they are too long and "--property" gives the context. Tags are handled in a different PR and also use set and remove but with "--tag". I don't think we need to change anything here. Think of it as saying this: For this type of entity I will "set" a "--property" to this "--value". -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825260164 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: The Apache CLI library doesn't support specifying parameters multiple times so we could not use the form "--property xxx --property yyy". We could support the form --properties a=b,c=d but I suggest we do that in another PR. For the user to be able to create a catalog quickly, it makes more sense to have the basic properties specified as named options, this way they don't need to look up the documentation or the REST spec to know exactly what properties need to be set. This makes it easier for the user. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825255686 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I didn't use set-property"set-property" or similar as they are too long and "--property" gives the context. Tags are handled in a different PR and also use set and remove but with "--tag". I don't think we need to change anything here. Think of it as saying this: For this type of I will "set" a "--property" to this "--value". -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825252130 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password ``` ## Commands -The following commands are available for entity management: +The following commands are used for entity management: - list: List available entities - details: Show detailed information about an entity - create: Create a new entity - delete: Delete an existing entity - update: Update an existing entity +- set: Set an entities property Review Comment: Yes in general words that start with a vowel use "an" rather than "a" and words that end in y the plural is "ies". But I can see that may be unclear so I've changed it to: - set: Set a property on an entity - remove: Remove a property from an entity -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1825249282
##
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListMetalakeProperties.java:
##
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli.commands;
+
+import java.util.Map;
+import org.apache.gravitino.Metalake;
+import org.apache.gravitino.cli.ErrorMessages;
+import org.apache.gravitino.client.GravitinoAdminClient;
+import org.apache.gravitino.exceptions.NoSuchMetalakeException;
+
+/** List the properties of a metalake. */
+public class ListMetalakeProperties extends ListProperties {
+
+ protected final String metalake;
+
+ /**
+ * List the properties of a metalake.
+ *
+ * @param url The URL of the Gravitino server.
+ * @param ignoreVersions If true don't check the client/server versions
match.
+ * @param metalake The name of the metalake.
+ */
+ public ListMetalakeProperties(String url, boolean ignoreVersions, String
metalake) {
+super(url, ignoreVersions);
+this.metalake = metalake;
+ }
+
+ /** List the properties of a metalake. */
+ public void handle() {
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
jerryshao commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824259855 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: I think we don't have to define specific argument for each catalog, for example using `--bootstrap` for Kafka catalog, they're all properties, we can treat all of them as properties, like: ``` --property a=b ``` User can specify multiple `--property a=b` and `--property c=d` to specify multiple catalog properties. Also you can add an argument for multiple properties, like: ``` --properties a=b,c=d ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
jerryshao commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824265726 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: In Gravitino Catalog REST spec, we use properties to properties to define specific parameters for each catalog, you can follow REST spec as a reference to define your command line arguments. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
jerryshao commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824262529 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password Review Comment: For example: ``` gcli catalog create --metalake metalake_demo --name iceberg --provider iceberg --metastore thrift://hive-host:9083 --warehouse hdfs://hdfs-host:9000/user/iceberg/warehouse ``` can change to: ``` gcli catalog create --metalake metalake_demo --name iceberg --provider iceberg --property xxx=thrift://hive-host:9083 --property yyy=hdfs://hdfs-host:9000/user/iceberg/warehouse ``` -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824234019 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I feel that "set-property" and "remove-property" are easier to understand, although they are longer. Say, except "property", Gravitino now supports "tag", which also have set-tag and remove-tag action. Please think about this, because once released, we may not easily change it. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824234019 ## docs/cli.md: ## @@ -109,7 +148,49 @@ gcli metalake list Show a metalake details ```bash -gcli metalake details --metalake metalake_demo +gcli metalake details --metalake metalake_demo +``` + + Create a metalake + +```bash +gcli metalake create --metalake my_metalake --comment "This is my metalake" +``` + + Delete a metalake + +```bash +gcli metalake delete --metalake my_metalake +``` + + Rename a metalake + +```bash +gcli metalake update --metalake metalake_demo --rename demo +``` + + Update a metalake's comment + +```bash +gcli metalake update --metalake metalake_demo --comment "new comment" +``` + + Display a metalake's properties + +```bash +gcli metalake properties --metalake metalake_demo +``` + + Set a metalake's property + +```bash +gcli metalake set --metalake metalake_demo --property test --value value Review Comment: I feel that "set-property" and "remove-property" are easier to understand, although they are longer. Say, except "property", Gravitino now supports "tag", which also have set-tag and remove-tag action. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824229695 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password ``` ## Commands -The following commands are available for entity management: +The following commands are used for entity management: - list: List available entities - details: Show detailed information about an entity - create: Create a new entity - delete: Delete an existing entity - update: Update an existing entity +- set: Set an entities property +- remove: Remove an entities property +- properties: Display an entities properties ### Setting the Metalake name -As dealing with one Metalake is a typical scenario, you can set the Metalake name in several ways. +As dealing with one Metalake is a typical scenario, you can set the Metalake name in several ways so it doesn't need to be passed on the command line. 1. Passed in on the command line via the `--metalake` parameter. 2. Set via the `GRAVITINO_METALAKE` environment variable. +3. Stored in the Gravitino CLI configuration file. The command line option overrides the environment variable. Review Comment: maybe this statement also need be updated, as the 3rd option was added. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117: URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824227309 ## docs/cli.md: ## @@ -8,52 +8,65 @@ last_update: license: 'This software is licensed under the Apache License version 2.' --- -This document primarily outlines how users can manage metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI is accessible via a terminal window as an alternative to writing code or using the REST interface. +This document provides guidance on managing metadata within Apache Gravitino using the Command Line Interface (CLI). The CLI offers a terminal based alternative to using code or the REST interface for metadata management. -Currently, you can view basic metadata information for metalakes, catalogs, schema, and tables. The ability to create, update, and delete metalakes and support additional entities in planned in the near future. +Currently, the CLI allows users to view metadata information for metalakes, catalogs, schemas, and tables. Future updates will expand on these capabilities to include roles, users, and tags. ## Running the CLI -You can set up an alias for the command like so: +You can configure an alias for the CLI for ease of use, with the following command: ```bash alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.jar' ``` -Or use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. +Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - To run the Gravitino CLI, use the following command structure: +The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash - usage: gcli [metalake|catalog|schema|table] [list|details|create|delete|update] [options] + usage: gcli [metalake|catalog|schema|table|column] [list|details|create|delete|update|set|remove|properties] [options] Options - -f,--namefull entity name (dot separated) - -h,--help command help information - -i,--ignore Ignore client/sever version check - -m,--metalakeMetalake name - -r,--server Gravitino server version - -u,--url Gravitino URL (default: http://localhost:8090) - -v,--version Gravitino client version + -b,--bootstrapKafka bootstrap servers + -c,--comment entity comment + -d,--database database name + -h,--help command help information + -i,--ignoreIgnore client/sever version check + -j,--jdbcurl JDBC URL + -l,--user database username + -m,--metastoreHive metastore URI + -n,--name full entity name (dot separated) + -p,--provider provider one of hadoop, hive, mysql, postgres, +iceberg, kafka + -r,--rename new entity name + -u,--url Gravitino URL (default: http://localhost:8090) + -v,--valueproperty value + -w,--warehousewarehouse name + -z,--password database password ``` ## Commands -The following commands are available for entity management: +The following commands are used for entity management: - list: List available entities - details: Show detailed information about an entity - create: Create a new entity - delete: Delete an existing entity - update: Update an existing entity +- set: Set an entities property Review Comment: "an entities property", is this grammatically correct? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r182419
##
clients/cli/src/main/java/org/apache/gravitino/cli/commands/ListMetalakeProperties.java:
##
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli.commands;
+
+import java.util.Map;
+import org.apache.gravitino.Metalake;
+import org.apache.gravitino.cli.ErrorMessages;
+import org.apache.gravitino.client.GravitinoAdminClient;
+import org.apache.gravitino.exceptions.NoSuchMetalakeException;
+
+/** List the properties of a metalake. */
+public class ListMetalakeProperties extends ListProperties {
+
+ protected final String metalake;
+
+ /**
+ * List the properties of a metalake.
+ *
+ * @param url The URL of the Gravitino server.
+ * @param ignoreVersions If true don't check the client/server versions
match.
+ * @param metalake The name of the metalake.
+ */
+ public ListMetalakeProperties(String url, boolean ignoreVersions, String
metalake) {
+super(url, ignoreVersions);
+this.metalake = metalake;
+ }
+
+ /** List the properties of a metalake. */
+ public void handle() {
Review Comment:
The handle() methods overwrites the parent's method, shall we add the
annotation to indicate this? This applies to all the classes I think.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824199925
##
clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java:
##
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli;
+
+import java.util.HashSet;
+import org.apache.gravitino.Catalog;
+
+/**
+ * The {@code CommandEntities} class defines a set of standard entities that
can be used in the
+ * Gravitino CLI. It also can validate if a given entity is a valid entity.
+ */
+public class Providers {
+ public static final String HIVE = "hive";
+ public static final String HADOOP = "hadoop";
+ public static final String ICEBERG = "iceberg";
+ public static final String MYSQL = "mysql";
+ public static final String POSTGRES = "postgres";
+ public static final String KAFKA = "kafka";
+
+ private static final HashSet VALID_PROVIDERS = new HashSet<>();
+
+ static {
+VALID_PROVIDERS.add(HIVE);
+VALID_PROVIDERS.add(HADOOP);
+VALID_PROVIDERS.add(ICEBERG);
+VALID_PROVIDERS.add(MYSQL);
+VALID_PROVIDERS.add(POSTGRES);
+VALID_PROVIDERS.add(KAFKA);
Review Comment:
These are not covered in this PR.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824199407
##
clients/cli/src/main/java/org/apache/gravitino/cli/Main.java:
##
@@ -35,6 +35,11 @@ public static void main(String[] args) {
try {
CommandLine line = parser.parse(options, args);
String entity = resolveEntity(line);
+ String[] extra = line.getArgs();
+ if (extra.length > 2) {
Review Comment:
the arguments don't include options and all commands have a maximum of two
arguments.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
justinmclean commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824198259
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
Which is fine as a) short options are generally not used b) they are not
exclusive and c) both options can't be used together.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824126282
##
clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java:
##
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli;
+
+import java.util.HashSet;
+import org.apache.gravitino.Catalog;
+
+/**
+ * The {@code CommandEntities} class defines a set of standard entities that
can be used in the
+ * Gravitino CLI. It also can validate if a given entity is a valid entity.
+ */
+public class Providers {
+ public static final String HIVE = "hive";
+ public static final String HADOOP = "hadoop";
+ public static final String ICEBERG = "iceberg";
+ public static final String MYSQL = "mysql";
+ public static final String POSTGRES = "postgres";
+ public static final String KAFKA = "kafka";
+
+ private static final HashSet VALID_PROVIDERS = new HashSet<>();
+
+ static {
+VALID_PROVIDERS.add(HIVE);
+VALID_PROVIDERS.add(HADOOP);
+VALID_PROVIDERS.add(ICEBERG);
+VALID_PROVIDERS.add(MYSQL);
+VALID_PROVIDERS.add(POSTGRES);
+VALID_PROVIDERS.add(KAFKA);
+ }
+
+ /**
+ * Checks if a given provider is a valid provider.
+ *
+ * @param provider The provider to check.
+ * @return true if the provider is valid, false otherwise.
+ */
+ public static boolean isValidProvider(String provider) {
+return VALID_PROVIDERS.contains(provider);
+ }
+
+ public static String internal(String provider) {
+switch (provider) {
+ case HIVE:
+return "hive";
+ case HADOOP:
+return "hadoop";
+ case MYSQL:
+return "jdbc-mysql";
+ case POSTGRES:
+return "jdbc-postgresql";
+ case ICEBERG:
+return "lakehouse-iceberg";
+ case KAFKA:
+return "kafka";
+}
+
+return null;
Review Comment:
It's better to throw an exception here, let the user know his input is
invalid or not supported yet.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824125244
##
clients/cli/src/main/java/org/apache/gravitino/cli/Providers.java:
##
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.cli;
+
+import java.util.HashSet;
+import org.apache.gravitino.Catalog;
+
+/**
+ * The {@code CommandEntities} class defines a set of standard entities that
can be used in the
+ * Gravitino CLI. It also can validate if a given entity is a valid entity.
+ */
+public class Providers {
+ public static final String HIVE = "hive";
+ public static final String HADOOP = "hadoop";
+ public static final String ICEBERG = "iceberg";
+ public static final String MYSQL = "mysql";
+ public static final String POSTGRES = "postgres";
+ public static final String KAFKA = "kafka";
+
+ private static final HashSet VALID_PROVIDERS = new HashSet<>();
+
+ static {
+VALID_PROVIDERS.add(HIVE);
+VALID_PROVIDERS.add(HADOOP);
+VALID_PROVIDERS.add(ICEBERG);
+VALID_PROVIDERS.add(MYSQL);
+VALID_PROVIDERS.add(POSTGRES);
+VALID_PROVIDERS.add(KAFKA);
Review Comment:
How about others, like Doris, Paimon, Hudi?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824123417
##
clients/cli/src/main/java/org/apache/gravitino/cli/Main.java:
##
@@ -35,6 +35,11 @@ public static void main(String[] args) {
try {
CommandLine line = parser.parse(options, args);
String entity = resolveEntity(line);
+ String[] extra = line.getArgs();
+ if (extra.length > 2) {
Review Comment:
One command can only has 1 argument?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [#5059] Add commands to create, delete and modify metalakes, catalogs and schema in CLI. [gravitino]
shaofengshi commented on code in PR #5117:
URL: https://github.com/apache/gravitino/pull/5117#discussion_r1824120778
##
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoOptions.java:
##
@@ -45,10 +58,26 @@ public Options options() {
options.addOption(createSimpleOption("v", VERSION, "Gravitino client
version"));
options.addOption(createSimpleOption("r", SERVER, "Gravitino server
version"));
options.addOption(createArgOption("u", URL, "Gravitino URL (default:
http://localhost:8090)"));
-options.addOption(createArgOption("f", NAME, "full entity name (dot
separated)"));
+options.addOption(createArgOption("n", NAME, "full entity name (dot
separated)"));
options.addOption(createArgOption("m", METALAKE, "Metalake name"));
options.addOption(createSimpleOption("i", IGNORE, "Ignore client/sever
version check"));
+// Create/update options
+options.addOption(createArgOption("r", RENAME, "new entity name"));
+options.addOption(createArgOption("c", COMMENT, "entity comment"));
+options.addOption(createArgOption("p", PROPERTY, "property name"));
+options.addOption(createArgOption("v", VALUE, "property value"));
+options.addOption(
+createArgOption(
+"p", PROVIDER, "provider one of hadoop, hive, mysql, postgres,
iceberg, kafka"));
Review Comment:
The short-name of "p" has been occupied by "property" above?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
