Skip to content

Commit

Permalink
Fixed compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
VigneshSK17 committed Jan 2, 2025
1 parent a0fad91 commit 8ce2946
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class ErrorMessages {
public static final String UNKNOWN_ROLE = "Unknown role.";
public static final String ROLE_EXISTS = "Role already exists.";
public static final String TABLE_EXISTS = "Table already exists.";
public static final String UNKNOWN_MODEL = "Unknown model.";
public static final String MODEL_EXISTS = "Model already exists.";
public static final String INVALID_SET_COMMAND =
"Unsupported combination of options either use --name, --user, --group or --property and --value.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,43 +498,6 @@ private void handleTableCommand() {
}
}

/**
* Handles the command execution for Models based on command type and the command line options.
*/
private void handleModelCommand() {
String url = getUrl();
String auth = getAuth();
String userName = line.getOptionValue(GravitinoOptions.LOGIN);
FullName name = new FullName(line);
String metalake = name.getMetalakeName();
String catalog = name.getCatalogName();

Command.setAuthenticationMode(auth, userName);
List<String> missingEntities = Lists.newArrayList();
if (metalake == null) missingEntities.add(CommandEntities.METALAKE);
if (catalog == null) missingEntities.add(CommandEntities.CATALOG);

String model = name.getModelName();
if (model == null) {
missingEntities.add(CommandEntities.MODEL);
}

if (!missingEntities.isEmpty()) {
System.err.println("Missing required argument(s): " + COMMA_JOINER.join(missingEntities));
Main.exit(-1);
}

switch (command) {
case CommandActions.DETAILS:
if (line.hasOption(GravitinoOptions.AUDIT)) {
newModelAudit(url, ignore, metalake, catalog, model).handle();
} else {
// newModelDetails(url, ignore, metalake, catalog, model).handle()
}
break;
}
}

/** Handles the command execution for Users based on command type and the command line options. */
protected void handleUserCommand() {
String url = getUrl();
Expand Down Expand Up @@ -1191,6 +1154,9 @@ private void handleFilesetCommand() {
}
}

/**
* Handles the command execution for Models based on command type and the command line options.
*/
private void handleModelCommand() {
String url = getUrl();
String auth = getAuth();
Expand Down Expand Up @@ -1219,7 +1185,11 @@ private void handleModelCommand() {

switch (command) {
case CommandActions.DETAILS:
newModelDetails(url, ignore, metalake, catalog, schema, model).handle();
if (line.hasOption(GravitinoOptions.AUDIT)) {
newModelAudit(url, ignore, metalake, catalog, schema, model).handle();
} else {
newModelDetails(url, ignore, metalake, catalog, schema, model).handle();
}
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.j
Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI.

## Usage

f
The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`.

```bash
Expand Down

0 comments on commit 8ce2946

Please sign in to comment.