Skip to content

Commit

Permalink
Sync fork (#3)
Browse files Browse the repository at this point in the history
* [apache#6384] fix: Gravitino default JVM config mismatches with comments from gravitino-env.sh (apache#6385)

<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
   Examples:
     - "[apache#123] feat(operator): support xxx"
     - "[apache#233] fix: check null before access result in xxx"
     - "[MINOR] refactor: fix typo in variable name"
     - "[MINOR] docs: fix typo in README"
     - "[apache#255] test: fix flaky test NameOfTheTest"
   Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->

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

Update Gravitino JVM memory default.

### Why are the changes needed?

Fix: apache#6384

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

No

### How was this patch tested?

No test

* [apache#6279] feat (gvfs-fuse): Add gvfs-fuse integration tests for big files and open-file flag test cases (apache#6280)

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

Add gvfs-fuse integration tests for big files and open-file flag test
cases

### Why are the changes needed?

Fix: apache#6279

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

No

### How was this patch tested?

IT

* [apache#6380] fix(postgres-sql): Fix errors for PG backend about `delete...limit..` clause. (apache#6393)

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

PostgreSQL does not support SQL sentences like `DELETE FROM xxxx_table
where xxxx limit 10` , Cluase `limit xxx` is not allowed in the `Delete
syntax`

### Why are the changes needed?

it's a bug.

Fix: apache#6380 

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

N/A

### How was this patch tested?

UT

* [apache#6356] improve(CLI): Add tag support for model in CLI (apache#6360)

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

 Add tag support for model in CLI.

1. `UntagEntity`
2. `TagEntity`
3. `ListEntityTags`

The logic for handling models in these three methods has been added.
need to add the processing logic to the `RemoveAllTags` method.

### Why are the changes needed?

Fix: apache#6356 

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

No

### How was this patch tested?

local test.

* [MINOR] fix(gvfs): expose the nested exception for better understanding (apache#6398)

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

Improve the gvfs to expose the nested exception for better
understanding.

### Why are the changes needed?

The exception message may not be enough to understand the problem why
the fs initialization is failed. So we should expose the whole stack for
better understanding.

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

No.

### How was this patch tested?

Existing tests.

* [apache#6375] improvment(catalog-hadoop): Remove `protobuf-java` to avoid conflict with authorization module (apache#6376)

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

Remove jar `protobuf-java.jar` from the distribution package to avoid
conflicts

### Why are the changes needed?

To make authorization works for GCS fileset.

Fix: apache#6375 

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

N/A.

### How was this patch tested?

N/A

* [apache#6394] feat(iceberg): upgrade Iceberg version from 1.5.2 to 1.6.1 (apache#6374)

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

Upgrade Iceberg version from 1.5.2 to 1.6.1

In 1.6, the `token` endpoint is deprecated and there're no new endpoint
is added.


### Why are the changes needed?

Fix: apache#6394 

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

### How was this patch tested?
run pass existing ITs

* [apache#6320] feat (gvfs-fuse): Support mount and umount command for gvfs-fuse command line tools (apache#6321)

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

1. Support mount and umount command
2. Make mount create a daemon process to run background


### Why are the changes needed?

Fix: apache#6320 

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

No

### How was this patch tested?

IT

---------

Co-authored-by: Qiming Teng <tengqm@outlook.com>

* [apache#6357] feat (gvfs-fuse): Passing file type argument in the Filesystem::stat() to improve the performance of open_dal_filesystem (apache#6358)

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

Passing file type argument in the Filesystem::stat() to improve the
performance of open_dal_filesystem

### Why are the changes needed?

Fix: apache#6357 

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

No

### How was this patch tested?

UI

---------

Co-authored-by: Qiming Teng <tengqm@outlook.com>

* [apache#6326] Refactor to add a command context to CLI (apache#6343)

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

Refactor to add a command context and simple wrappers on output to make
it easy for "global" command like a "--quiet" option to be added.

Note this in progress as this only has changed Metlake. Some duplicate
code can be removed once everything is done.

### Why are the changes needed?

For maintainability.

Fix: apache#6326

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

No.

### How was this patch tested?

Tested locally.

---------

Co-authored-by: Shaofeng Shi <shaofengshi@gmail.com>

* [apache#6407] improve(client-python): Reorganize the python package (apache#6408)

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

Move the `Fileset` and `Model` related classes to the sub-package for
better organized.

### Why are the changes needed?

For better organized.

Fix: apache#6407 

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

No.

### How was this patch tested?

Existing tests.

* [apache#5900] feat(tag): support tag pre-event to Gravitino server (apache#5980)

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

Implemented pre-event handling for all tag-related operations,
including:

- listTags
- listTagsInfo
- getTag
- createTag
- alterTag
- deleteTag
- listMetadataObjectsForTag
- listTagsForMetadataObject
- listTagsInfoForMetadataObject
- associateTagsForMetadataObject
- getTagForMetadataObject

### Why are the changes needed?
Fix: apache#5900

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

### How was this patch tested?
add UT

* [apache#6409] fix(client-python): Change to use `GenericFileset`  for the return value of fileset catalog (apache#6410)

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

This PR changes the return value to `GenericFileset` for fileset
operation.

### Why are the changes needed?

Previously, it returns the plain fileset dto, so that it cannot support
some operations like get credentials.

Fix: apache#6409 

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

No.

### How was this patch tested?

Existing tests.

* [apache#5932] improve(CLI): Fix the CLI  delete the anonymous user (apache#6359)

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

Fix the CLI  delete the anonymous user
### Why are the changes needed?

Fix: apache#5932 

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

(Please list the user-facing changes introduced by your change,
including
  1. Change in user-facing APIs.
  2. Addition or removal of property keys.)

### How was this patch tested?

local test

```bash
gcli user delete -m demo_metalake --user anonymous
# Can't delete anonymous user. This will cause unexpected behavior.
```

<img width="536" alt="image"
src="https://github.com/user-attachments/assets/479ec7eb-2ad3-42bd-b70a-a6f2ce05f794"
/>

* [apache#6419] improve(CLI): Add table command context CLI (apache#6428)

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

Add table command context CLI.

### Why are the changes needed?

Fix: apache#6419 

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

No

### How was this patch tested?

local test.

* [apache#6415] improve(CLI): Add Fileset command context CLI (apache#6431)

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

Add Fileset command context CLI

### Why are the changes needed?

Fix: apache#6415 

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

No

### How was this patch tested?

local test

* [apache#6417] improve(CLI): Add model command context CLI (apache#6430)

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

Add model command context CLI

### Why are the changes needed?

Fix: apache#6417 

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

No

### How was this patch tested?

local test

* [apache#6416] improve(CLI): Add schema command context CLI (apache#6427)

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

Add schema command context CLI

### Why are the changes needed?

Fix: apache#6416 

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

No

### How was this patch tested?

local test.

* [apache#6414] improve(CLI): Add catalog command context CLI (apache#6425)

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

Add catalog command context CLI

### Why are the changes needed?

Fix: apache#6414 

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

No

### How was this patch tested?

local test.

* [apache#6418] improve(CLI): Add stream command context CLI (apache#6434)

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

Add stream command context CLI

### Why are the changes needed?

Fix: apache#6418 

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

No

### How was this patch tested?

local test.

* [apache#6420] improve(CLI): Add column command context CLI (apache#6436)

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

Add column command context CLI

### Why are the changes needed?

Fix: apache#6420 

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

No

### How was this patch tested?

local test.

* [MINOR] docs: Fix the description of `Multi-engine support` in `overview.md` (apache#6439)

### What changes were proposed in this pull request?
This PR fixes the description of the `Multi-engine support` section in
`overview.md`, as Gravitino now supports connectors for Apache Spark and
Apache Flink.

### Why are the changes needed?
Gravitino now supports connectors for Apache Spark and Apache Flink.


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

### How was this patch tested?
manual review

* [apache#6423] improve(CLI): Add tags command context CLI (apache#6435)

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

Add tags command context CLI

### Why are the changes needed?

Fix: apache#6423 

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

No

### How was this patch tested?

local test

* [apache#6421] improve(CLI): Add user and group command context CLI (apache#6437)

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

 Add user and group command context CLI

### Why are the changes needed?

Fix: apache#6421

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

No

### How was this patch tested?

local test.

* [apache#6422] improve(CLI): Add roles and owner command context CLI (apache#6438)

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

Add roles and owner command context CLI

### Why are the changes needed?

Fix: apache#6422 

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

No.

### How was this patch tested?

local test.

* [apache#6424] improve(CLI): Refactor getURL in CLI and add context to simple commands. (apache#6440)

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

Refactor getURL in CLI and add context to simple commands.

### Why are the changes needed?

Fix: apache#6424 

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

No

### How was this patch tested?

local test.

* [apache#6429] Fixed Wrong log format codes (apache#6433)

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

The PR updates incorrect log format codes from `%s` to `{}` in the
following lines:

- Line 420
- Line 483
- Line 504
- Line 525

The original code in these lines used the `%s` placeholder, which is
invalid for the logging framework used. It has been corrected to use
`{}` to match the proper syntax for log messages.

### Why are the changes needed?

This change is necessary to fix the incorrect log format codes in the
codebase. The `%s` placeholder is not valid and can lead to incorrect
log formatting or errors when the logs are generated. The correct
placeholder syntax for this logging framework is `{}`.

Fix: apache#6429

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

No user-facing changes are introduced. This is an internal fix for the
logging format.

### How was this patch tested?

The changes were verified manually by reviewing the code and ensuring
that all instances of `%s` were replaced with `{}` in the affected
lines. No new functionality was added, so no additional tests were
required.

* [apache#6361] feat(paimon):Support specifying primary keys during create paimon table by flink (apache#6362)

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

Support specifying primary keys during create paimon table by flink

### Why are the changes needed?


Fix: apache#6361 

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

None

### How was this patch tested?

Add testCreateTableWithPrimaryKey case in
org.apache.gravitino.flink.connector.integration.test.FlinkCommonIT

* [MINOR] docs: polish Iceberg REST server document (apache#6444)

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

multi catalog and view operation should shown in document side bars.

### Why are the changes needed?
User could find multi catalog configuration easily

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

### How was this patch tested?
just document

* [MINOR] improve(CLI): Remove redundant code in CLI (apache#6443)

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

Remove redundant code in CLI, and make context argument final in Command
class.

### Why are the changes needed?

The constructor should take only one argument, CommandContext.

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

No.

### How was this patch tested?

local test.

* [apache#6097] improve(CLI): Add --quiet option to the Gravitino CLI (apache#6447)

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

Add --quiet option to the Gravitino CLI

### Why are the changes needed?

Fix: apache#6097 

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

user can use --quiet option suppress the output.

### How was this patch tested?

local test

```bash
gcli tag create -m cli_demo --tag tagA tagB -i
# Tags tagA,tagB created

gcli tag create -m cli_demo --tag tagC tagD -i --quiet
# no output
```

* [apache#6449] improve(CLI): Refactor getAuth method in CLI (apache#6451)

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

Refactor getAuth method in CLI.

### Why are the changes needed?

Fix: apache#6449

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

No

### How was this patch tested?

local test.

* [apache#6450] fix(web): fix authentication.type issue (apache#6452)

### What changes were proposed in this pull request?
authentication.type of catalog property should send correct request to
server

### Why are the changes needed?
N/A

Fix: apache#6450

### Does this PR introduce _any_ user-facing change?
N/A

### How was this patch tested?
manually

---------

Co-authored-by: Pucheng Yang <8072956+puchengy@users.noreply.github.com>
Co-authored-by: Yuhui <hui@datastrato.com>
Co-authored-by: Qi Yu <yuqi@datastrato.com>
Co-authored-by: Lord of Abyss <103809695+Abyss-lord@users.noreply.github.com>
Co-authored-by: Jerry Shao <jerryshao@datastrato.com>
Co-authored-by: FANNG <xiaojing@datastrato.com>
Co-authored-by: Qiming Teng <tengqm@outlook.com>
Co-authored-by: Justin Mclean <justin@classsoftware.com>
Co-authored-by: Shaofeng Shi <shaofengshi@gmail.com>
Co-authored-by: Lychee <62695685+amazingLychee@users.noreply.github.com>
Co-authored-by: YangJie <yangjie01@baidu.com>
Co-authored-by: Aryan Mahawar <aryanmahawar205@gmail.com>
Co-authored-by: yangyang zhong <35210666+hdygxsj@users.noreply.github.com>
Co-authored-by: Qian Xia <lauraxiaqian@gmail.com>
  • Loading branch information
15 people authored Feb 14, 2025
1 parent 342a666 commit a0f8017
Show file tree
Hide file tree
Showing 260 changed files with 4,596 additions and 2,819 deletions.
2 changes: 1 addition & 1 deletion bin/common.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function addDirToClasspath(){
}

if [[ -z "${GRAVITINO_MEM}" ]]; then
export GRAVITINO_MEM="-Xmx1024m"
export GRAVITINO_MEM="-Xms1024m -Xmx1024m -XX:MaxMetaspaceSize=512m"
fi

if [[ -n "${JAVA_HOME}" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ allprojects {
param.environment("NEED_CREATE_DOCKER_NETWORK", "true")
}

val icebergVersion: String = libs.versions.iceberg.get()
param.systemProperty("ICEBERG_VERSION", icebergVersion)

// Change poll image pause time from 30s to 60s
param.environment("TESTCONTAINERS_PULL_PAUSE_TIMEOUT", "60")
val jdbcDatabase = project.properties["jdbcBackend"] as? String ?: "h2"
Expand Down
6 changes: 6 additions & 0 deletions catalogs/catalog-hadoop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ dependencies {
exclude("org.eclipse.jetty", "*")
exclude("io.netty")
exclude("org.fusesource.leveldbjni")
// Exclude `protobuf-java` 2.5.0 to avoid conflict with a higher version of `protobuf-java`
// in the authorization module. The reason is that the class loader of `catalog-hadoop` is the
// parent of the class loader of the authorization module, so the class loader of `catalog-hadoop`
// will load the class `protobuf-java` 2.5.0 first, which will cause the authorization module to
// fail to load the class `protobuf-java` 3.15.8.
exclude("com.google.protobuf", "protobuf-java")
}
implementation(libs.slf4j.api)
implementation(libs.awaitility)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,38 @@ public class CatalogCommandHandler extends CommandHandler {
private final GravitinoCommandLine gravitinoCommandLine;
private final CommandLine line;
private final String command;
private final boolean ignore;
private final String url;
private final CommandContext context;
private final FullName name;
private final String metalake;
private String catalog;
private final String outputFormat;

/**
* Constructs a {@link CatalogCommandHandler} instance.
*
* @param gravitinoCommandLine The Gravitino command line instance.
* @param line The command line arguments.
* @param command The command to execute.
* @param ignore Ignore server version mismatch.
* @param context The command context.
*/
public CatalogCommandHandler(
GravitinoCommandLine gravitinoCommandLine, CommandLine line, String command, boolean ignore) {
GravitinoCommandLine gravitinoCommandLine,
CommandLine line,
String command,
CommandContext context) {
this.gravitinoCommandLine = gravitinoCommandLine;
this.line = line;
this.command = command;
this.ignore = ignore;
this.context = context;

this.url = getUrl(line);
this.name = new FullName(line);
this.metalake = name.getMetalakeName();
this.outputFormat = line.getOptionValue(GravitinoOptions.OUTPUT);
}

/** Handles the command execution logic based on the provided command. */
@Override
protected void handle() {
String userName = line.getOptionValue(GravitinoOptions.LOGIN);
Command.setAuthenticationMode(getAuth(line), userName);
Command.setAuthenticationMode(context.auth(), userName);
List<String> missingEntities = Lists.newArrayList();

if (CommandActions.LIST.equals(command)) {
Expand Down Expand Up @@ -126,12 +125,9 @@ private boolean executeCommand() {
/** Handles the "DETAILS" command. */
private void handleDetailsCommand() {
if (line.hasOption(GravitinoOptions.AUDIT)) {
gravitinoCommandLine.newCatalogAudit(url, ignore, metalake, catalog).validate().handle();
gravitinoCommandLine.newCatalogAudit(context, metalake, catalog).validate().handle();
} else {
gravitinoCommandLine
.newCatalogDetails(url, ignore, outputFormat, metalake, catalog)
.validate()
.handle();
gravitinoCommandLine.newCatalogDetails(context, metalake, catalog).validate().handle();
}
}

Expand All @@ -143,26 +139,22 @@ private void handleCreateCommand() {

Map<String, String> propertyMap = new Properties().parse(properties);
gravitinoCommandLine
.newCreateCatalog(url, ignore, metalake, catalog, provider, comment, propertyMap)
.newCreateCatalog(context, metalake, catalog, provider, comment, propertyMap)
.validate()
.handle();
}

/** Handles the "DELETE" command. */
private void handleDeleteCommand() {
boolean force = line.hasOption(GravitinoOptions.FORCE);
gravitinoCommandLine
.newDeleteCatalog(url, ignore, force, metalake, catalog)
.validate()
.handle();
gravitinoCommandLine.newDeleteCatalog(context, metalake, catalog).validate().handle();
}

/** Handles the "SET" command. */
private void handleSetCommand() {
String property = line.getOptionValue(GravitinoOptions.PROPERTY);
String value = line.getOptionValue(GravitinoOptions.VALUE);
gravitinoCommandLine
.newSetCatalogProperty(url, ignore, metalake, catalog, property, value)
.newSetCatalogProperty(context, metalake, catalog, property, value)
.validate()
.handle();
}
Expand All @@ -171,17 +163,14 @@ private void handleSetCommand() {
private void handleRemoveCommand() {
String property = line.getOptionValue(GravitinoOptions.PROPERTY);
gravitinoCommandLine
.newRemoveCatalogProperty(url, ignore, metalake, catalog, property)
.newRemoveCatalogProperty(context, metalake, catalog, property)
.validate()
.handle();
}

/** Handles the "PROPERTIES" command. */
private void handlePropertiesCommand() {
gravitinoCommandLine
.newListCatalogProperties(url, ignore, metalake, catalog)
.validate()
.handle();
gravitinoCommandLine.newListCatalogProperties(context, metalake, catalog).validate().handle();
}

/** Handles the "UPDATE" command. */
Expand All @@ -193,32 +182,32 @@ private void handleUpdateCommand() {
if (line.hasOption(GravitinoOptions.ENABLE)) {
boolean enableMetalake = line.hasOption(GravitinoOptions.ALL);
gravitinoCommandLine
.newCatalogEnable(url, ignore, metalake, catalog, enableMetalake)
.newCatalogEnable(context, metalake, catalog, enableMetalake)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.DISABLE)) {
gravitinoCommandLine.newCatalogDisable(url, ignore, metalake, catalog).validate().handle();
gravitinoCommandLine.newCatalogDisable(context, metalake, catalog).validate().handle();
}

if (line.hasOption(GravitinoOptions.COMMENT)) {
String updateComment = line.getOptionValue(GravitinoOptions.COMMENT);
gravitinoCommandLine
.newUpdateCatalogComment(url, ignore, metalake, catalog, updateComment)
.newUpdateCatalogComment(context, metalake, catalog, updateComment)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.RENAME)) {
String newName = line.getOptionValue(GravitinoOptions.RENAME);
gravitinoCommandLine
.newUpdateCatalogName(url, ignore, metalake, catalog, newName)
.newUpdateCatalogName(context, metalake, catalog, newName)
.validate()
.handle();
}
}

/** Handles the "LIST" command. */
private void handleListCommand() {
gravitinoCommandLine.newListCatalogs(url, ignore, outputFormat, metalake).validate().handle();
gravitinoCommandLine.newListCatalogs(context, metalake).validate().handle();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public class ColumnCommandHandler extends CommandHandler {
private final GravitinoCommandLine gravitinoCommandLine;
private final CommandLine line;
private final String command;
private final boolean ignore;
private final String url;
private final CommandContext context;
private final FullName name;
private final String metalake;
private final String catalog;
Expand All @@ -44,16 +43,18 @@ public class ColumnCommandHandler extends CommandHandler {
* @param gravitinoCommandLine The Gravitino command line instance.
* @param line The command line arguments.
* @param command The command to execute.
* @param ignore Ignore server version mismatch.
* @param context The command context.
*/
public ColumnCommandHandler(
GravitinoCommandLine gravitinoCommandLine, CommandLine line, String command, boolean ignore) {
GravitinoCommandLine gravitinoCommandLine,
CommandLine line,
String command,
CommandContext context) {
this.gravitinoCommandLine = gravitinoCommandLine;
this.line = line;
this.command = command;
this.ignore = ignore;
this.context = context;

this.url = getUrl(line);
this.name = new FullName(line);
this.metalake = name.getMetalakeName();
this.catalog = name.getCatalogName();
Expand All @@ -65,7 +66,7 @@ public ColumnCommandHandler(
@Override
protected void handle() {
String userName = line.getOptionValue(GravitinoOptions.LOGIN);
Command.setAuthenticationMode(getAuth(line), userName);
Command.setAuthenticationMode(context.auth(), userName);

List<String> missingEntities = Lists.newArrayList();
if (catalog == null) missingEntities.add(CommandEntities.CATALOG);
Expand Down Expand Up @@ -120,7 +121,7 @@ private boolean executeCommand() {
private void handleDetailsCommand() {
if (line.hasOption(GravitinoOptions.AUDIT)) {
gravitinoCommandLine
.newColumnAudit(url, ignore, metalake, catalog, schema, table, column)
.newColumnAudit(context, metalake, catalog, schema, table, column)
.validate()
.handle();
} else {
Expand All @@ -144,8 +145,7 @@ private void handleCreateCommand() {

gravitinoCommandLine
.newAddColumn(
url,
ignore,
context,
metalake,
catalog,
schema,
Expand All @@ -164,7 +164,7 @@ private void handleCreateCommand() {
/** Handles the "DELETE" command. */
private void handleDeleteCommand() {
gravitinoCommandLine
.newDeleteColumn(url, ignore, metalake, catalog, schema, table, column)
.newDeleteColumn(context, metalake, catalog, schema, table, column)
.validate()
.handle();
}
Expand All @@ -174,44 +174,43 @@ private void handleUpdateCommand() {
if (line.hasOption(GravitinoOptions.COMMENT)) {
String comment = line.getOptionValue(GravitinoOptions.COMMENT);
gravitinoCommandLine
.newUpdateColumnComment(url, ignore, metalake, catalog, schema, table, column, comment)
.newUpdateColumnComment(context, metalake, catalog, schema, table, column, comment)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.RENAME)) {
String newName = line.getOptionValue(GravitinoOptions.RENAME);
gravitinoCommandLine
.newUpdateColumnName(url, ignore, metalake, catalog, schema, table, column, newName)
.newUpdateColumnName(context, metalake, catalog, schema, table, column, newName)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.DATATYPE) && !line.hasOption(GravitinoOptions.DEFAULT)) {
String datatype = line.getOptionValue(GravitinoOptions.DATATYPE);
gravitinoCommandLine
.newUpdateColumnDatatype(url, ignore, metalake, catalog, schema, table, column, datatype)
.newUpdateColumnDatatype(context, metalake, catalog, schema, table, column, datatype)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.POSITION)) {
String position = line.getOptionValue(GravitinoOptions.POSITION);
gravitinoCommandLine
.newUpdateColumnPosition(url, ignore, metalake, catalog, schema, table, column, position)
.newUpdateColumnPosition(context, metalake, catalog, schema, table, column, position)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.NULL)) {
boolean nullable = line.getOptionValue(GravitinoOptions.NULL).equals("true");
gravitinoCommandLine
.newUpdateColumnNullability(
url, ignore, metalake, catalog, schema, table, column, nullable)
.newUpdateColumnNullability(context, metalake, catalog, schema, table, column, nullable)
.validate()
.handle();
}
if (line.hasOption(GravitinoOptions.AUTO)) {
boolean autoIncrement = line.getOptionValue(GravitinoOptions.AUTO).equals("true");
gravitinoCommandLine
.newUpdateColumnAutoIncrement(
url, ignore, metalake, catalog, schema, table, column, autoIncrement)
context, metalake, catalog, schema, table, column, autoIncrement)
.validate()
.handle();
}
Expand All @@ -220,7 +219,7 @@ private void handleUpdateCommand() {
String dataType = line.getOptionValue(GravitinoOptions.DATATYPE);
gravitinoCommandLine
.newUpdateColumnDefault(
url, ignore, metalake, catalog, schema, table, column, defaultValue, dataType)
context, metalake, catalog, schema, table, column, defaultValue, dataType)
.validate()
.handle();
}
Expand All @@ -229,7 +228,7 @@ private void handleUpdateCommand() {
/** Handles the "LIST" command. */
private void handleListCommand() {
gravitinoCommandLine
.newListColumns(url, ignore, metalake, catalog, schema, table)
.newListColumns(context, metalake, catalog, schema, table)
.validate()
.handle();
}
Expand Down
Loading

0 comments on commit a0f8017

Please sign in to comment.