Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into iceberg-properties
Browse files Browse the repository at this point in the history
  • Loading branch information
caican00 committed May 22, 2024
2 parents 98f85ce + 2687f1a commit 28dfe4b
Show file tree
Hide file tree
Showing 169 changed files with 4,286 additions and 1,602 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- 'gravitino-ci-doris'
- 'trino'
- 'hive'
- 'gravitino-ci-kerberos-hive'
tag:
description: 'Docker tag to apply to this image'
required: true
Expand All @@ -37,6 +38,9 @@ jobs:
if [ "${{ github.event.inputs.image }}" == "gravitino-ci-hive" ]; then
echo "image_type=hive" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-kerberos-hive" ]; then
echo "image_type=kerberos-hive" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-kerberos-hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-trino" ]; then
echo "image_type=trino" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-trino" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ out/**
*.ipr

distribution
common/src/main/resources/project.properties
common/src/main/resources/gravitino-build-info.properties

dev/docker/*/packages
docs/build
Expand Down
34 changes: 28 additions & 6 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,49 @@ Maintainers may be added once approved by the existing maintainers (see [Governa
| **NAME** | **GitHub Username** | **Organization** |
|---------------|---------------------|------------------|
| Justin Mclean | justinmclean | Datastrato |
| Heng Qin | qqqttt123 | Datastrato |
| McHades | mchades | Datastrato |
| He Qi | qqqttt123 | Datastrato |
| Minghuang Li | mchades | Datastrato |
| Xun Liu | xunliu | Datastrato |
| Hui Yu | diqiu50 | Datastrato |
| Xiaojing Fang | FANNG1 | Datastrato |
| Qi Yu | yuqi1129 | Datastrato |
| Clearvive | Clearvive | Datastrato |
| Cheyne | ch3yne | Datastrato |
| Jerry Shao | jerryshao | Datastrato |
| Decheng Liu | ch3yne | Datastrato |
| Saisai Shao | jerryshao | Datastrato |
| Shaofeng Shi | shaofengshi | Datastrato |
| Lisa Cao | lisancao | Datastrato |
| Qian Xia | LauraXia123 | Datastrato |
| Danhua Wang | danhuawang | Datastrato |

# Contributors

Contributors may be added by existing maintainers (see [Governance document](GOVERNANCE.md)). By adding your name to this list you agree to follow the project's guidelines and governance including the [Code of Conduct](CODE-OF-CONDUCT.md) and that you have permission to contribute from your employer. All contributions are licensed under the Apache License version 2.

| **NAME** | **GitHub Username** | **Organization** |
|----------------|---------------------|------------------|
| Kuan-Po Tseng | brandboat | opensource4you |
| Kuan-Po Tseng | brandboat | SUSE |
| Nicholas Jiang | SteNicholas | Bilibili |
| Eric Chang | unknowntpo | Lawsnote |
| Sophie Sun | SophieTech88 | ExtraHop Network |
| Xing Yong | YxAc | Xiaomi |
| Liwei Yang | lw-yang | Xiaomi |
| Yu-Ting Wang | noidname01 | opensource4you |
| Ziva Li | zivali | Yahoo |
| Kang Zhou | zhoukangcn | Xiaomi |
| Han Zhang | xiaozcy | Xiaomi |
| Yu-Hsin Lai | laiyousin | Virginia Tech |
| Charlie Cheng | charliecheng630 | cacaFly |
| PoAn Yang | FrankYang0592 | SUSE |
| Congling Xia | xiacongling | Xiaomi |
| JieBao Xiao | xloya | Xiaomi |
| Can Cai | caican00 | Xiaomi |
| Peidian Li | coolderli | Xiaomi |
| Brandon Lu | Lanznx | LINE |
| Lewis Jackson | xnge | opensource4you |
| Li-Hsing Liu | austin362667 | opensource4you |
| Tianhang Li | TEOTEO520 | Bilibili |
| Hiren Sharma | hiirrxnn | opensource4you |
| Chun-Hung Tseng| henrybear327 | opensource4you |
| Carl Chang | ichuniq | opensource4you |

## Review process

Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/com/datastrato/gravitino/Catalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import com.datastrato.gravitino.annotation.Evolving;
import com.datastrato.gravitino.file.FilesetCatalog;
import com.datastrato.gravitino.messaging.TopicCatalog;
import com.datastrato.gravitino.rel.SupportsSchemas;
import com.datastrato.gravitino.rel.TableCatalog;
import java.util.Map;

/**
* The interface of a catalog. The catalog is the second level entity in the gravitino system,
* containing a set of tables.
* containing a set of tables. The server side should use the other one with the same name in the
* core module.
*/
@Evolving
public interface Catalog extends Auditable {
Expand Down Expand Up @@ -72,8 +72,8 @@ enum Type {
/**
* Return the {@link SupportsSchemas} if the catalog supports schema operations.
*
* @throws UnsupportedOperationException if the catalog does not support schema operations.
* @return The {@link SupportsSchemas} if the catalog supports schema operations.
* @throws UnsupportedOperationException if the catalog does not support schema operations.
*/
default SupportsSchemas asSchemas() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Catalog does not support schema operations");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* Copyright 2023 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.rel;
package com.datastrato.gravitino;

import com.datastrato.gravitino.Auditable;
import com.datastrato.gravitino.annotation.Evolving;
import java.util.Collections;
import java.util.Map;
Expand All @@ -16,7 +15,7 @@
* which means it can be schema1.schema2.table.
*
* <p>This defines the basic properties of a schema. A catalog implementation with {@link
* SupportsSchemas} should implement this interface.
* com.datastrato.gravitino.SupportsSchemas} should implement this interface.
*/
@Evolving
public interface Schema extends Auditable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Referred from Apache Spark's connector/catalog implementation
// sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/NamespaceChange.java

package com.datastrato.gravitino.rel;
package com.datastrato.gravitino;

import com.datastrato.gravitino.annotation.Evolving;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.rel;
package com.datastrato.gravitino;

import com.datastrato.gravitino.Catalog;
import com.datastrato.gravitino.CatalogChange;
import com.datastrato.gravitino.CatalogProvider;
import com.datastrato.gravitino.NameIdentifier;
import com.datastrato.gravitino.annotation.Evolving;
import com.datastrato.gravitino.exceptions.CatalogAlreadyExistsException;
import com.datastrato.gravitino.exceptions.NoSuchCatalogException;
Expand Down Expand Up @@ -65,8 +61,8 @@ default boolean catalogExists(String catalogName) {
* Create a catalog with specified identifier.
*
* <p>The parameter "provider" is a short name of the catalog, used to tell Gravitino which
* catalog should be created. The short name should be the same as the {@link CatalogProvider}
* interface provided.
* catalog should be created. The short name should be the same as the {@link
* com.datastrato.gravitino.CatalogProvider} interface provided.
*
* @param catalogName the name of the catalog.
* @param type the type of the catalog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.rel;
package com.datastrato.gravitino;

import com.datastrato.gravitino.Metalake;
import com.datastrato.gravitino.MetalakeChange;
import com.datastrato.gravitino.annotation.Evolving;
import com.datastrato.gravitino.exceptions.MetalakeAlreadyExistsException;
import com.datastrato.gravitino.exceptions.NoSuchMetalakeException;
Expand Down
113 changes: 113 additions & 0 deletions api/src/main/java/com/datastrato/gravitino/SupportsSchemas.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* 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.
*/

// Referred from Apache Spark's connector/catalog implementation
// sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportNamespaces.java

package com.datastrato.gravitino;

import com.datastrato.gravitino.annotation.Evolving;
import com.datastrato.gravitino.exceptions.NoSuchCatalogException;
import com.datastrato.gravitino.exceptions.NoSuchSchemaException;
import com.datastrato.gravitino.exceptions.NonEmptySchemaException;
import com.datastrato.gravitino.exceptions.SchemaAlreadyExistsException;
import java.util.Map;

/**
* The client interface to support schema operations. The server side should use the other one with
* the same name in the core module.
*/
@Evolving
public interface SupportsSchemas {

/**
* List schemas under the entity.
*
* <p>If an entity such as a table, view exists, its parent schemas must also exist and must be
* returned by this discovery method. For example, if table a.b.t exists, this method invoked as
* listSchemas(a) must return [a.b] in the result array
*
* @return An array of schema identifier under the namespace.
* @throws NoSuchCatalogException If the catalog does not exist.
*/
NameIdentifier[] listSchemas() throws NoSuchCatalogException;

/**
* Check if a schema exists.
*
* <p>If an entity such as a table, view exists, its parent namespaces must also exist. For
* example, if table a.b.t exists, this method invoked as schemaExists(a.b) must return true.
*
* @param schemaName The name of the schema.
* @return True if the schema exists, false otherwise.
*/
default boolean schemaExists(String schemaName) {
try {
loadSchema(schemaName);
return true;
} catch (NoSuchSchemaException e) {
return false;
}
}

/**
* Create a schema in the catalog.
*
* @param schemaName The name of the schema.
* @param comment The comment of the schema.
* @param properties The properties of the schema.
* @return The created schema.
* @throws NoSuchCatalogException If the catalog does not exist.
* @throws SchemaAlreadyExistsException If the schema already exists.
*/
Schema createSchema(String schemaName, String comment, Map<String, String> properties)
throws NoSuchCatalogException, SchemaAlreadyExistsException;

/**
* Load metadata properties for a schema.
*
* @param schemaName The name of the schema.
* @return A schema.
* @throws NoSuchSchemaException If the schema does not exist (optional).
*/
Schema loadSchema(String schemaName) throws NoSuchSchemaException;

/**
* Apply the metadata change to a schema in the catalog.
*
* @param schemaName The name of the schema.
* @param changes The metadata changes to apply.
* @return The altered schema.
* @throws NoSuchSchemaException If the schema does not exist.
*/
Schema alterSchema(String schemaName, SchemaChange... changes) throws NoSuchSchemaException;

/**
* Drop a schema from the catalog. If cascade option is true, recursively drop all objects within
* the schema.
*
* <p>If the catalog implementation does not support this operation, it may throw {@link
* UnsupportedOperationException}.
*
* @param schemaName The name of the schema.
* @param cascade If true, recursively drop all objects within the schema.
* @return True if the schema exists and is dropped successfully, false if the schema doesn't
* exist.
* @throws NonEmptySchemaException If the schema is not empty and cascade is false.
*/
boolean dropSchema(String schemaName, boolean cascade) throws NonEmptySchemaException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public interface Privilege {
/** @return A readable string representation for the privilege. */
String simpleString();

/**
* @return The condition of the privilege. `ALLOW` means that you are allowed to use the
* privilege, `DENY` means that you are denied to use the privilege
*/
Condition condition();

/** The name of this privilege. */
enum Name {
/** The privilege to create a catalog. */
Expand Down Expand Up @@ -116,4 +122,16 @@ public long getHighBits() {
return highBits;
}
}

/**
* The condition of this privilege. `ALLOW` means that you are allowed to use the privilege,
* `DENY` means that you are denied to use the privilege. If you have `ALLOW` and `DENY` for the
* same privilege name of the same securable object, the `DENY` will take effect.
*/
enum Condition {
/** Allow to use the privilege */
ALLOW,
/** Deny to use the privilege */
DENY
}
}
Loading

0 comments on commit 28dfe4b

Please sign in to comment.