Skip to content

Commit

Permalink
[MINOR] fix: Correct some typos and grammar issues (#4282)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Correct some typos and grammar issues.

### Why are the changes needed?

Better code readability & maintainability.

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

No.

### How was this patch tested?

Existing UTs.
  • Loading branch information
rickyma authored Jul 26, 2024
1 parent 966f520 commit 4a590f8
Show file tree
Hide file tree
Showing 33 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface User extends Auditable {

/**
* The name of the user. It's the identifier of User. It must be unique. Usually the name comes
* from a external user management system like LDAP, IAM and so on.
* from an external user management system like LDAP, IAM and so on.
*
* @return The name of the user.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ default Table createTable(
* @param distribution The distribution of the table
* @param sortOrders The sort orders of the table
* @param partitions The table partitioning.
* @return Fhe created table metadata.
* @return The created table metadata.
* @throws NoSuchSchemaException If the schema does not exist.
* @throws TableAlreadyExistsException If the table already exists.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ private static DayTransform day(NamedReference ref) {
}

/**
* Create a hour transform that applies a function to the input value.
* Create an hour transform that applies a function to the input value.
*
* @param ref The reference to transform.
* @return A hour transform.
* @return An hour transform.
*/
private static HourTransform hour(NamedReference ref) {
return new HourTransform(ref);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static Builder builder() {
return new Builder();
}

/** Builder to create a index. */
/** Builder to create an index. */
public static class Builder {

/** The type of the index. */
Expand Down
2 changes: 1 addition & 1 deletion catalogs/catalog-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id("java")
}

// try avoid add extra dependencies because it is used by catalogs and connectors.
// try to avoid adding extra dependencies because it is used by catalogs and connectors.
dependencies {
implementation(libs.slf4j.api)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

/**
* Hadoop catalog is a fileset catalog that can manage filesets on the Hadoop Compatible File
* Systems, like Local, HDFS, S3, ADLS, etc, using the Hadoop FileSystem API. It can manage filesets
* from different Hadoop Compatible File Systems in the same catalog.
* Systems, like Local, HDFS, S3, ADLS, etc., using the Hadoop FileSystem API. It can manage
* filesets from different Hadoop Compatible File Systems in the same catalog.
*/
public class HadoopCatalog extends BaseCatalog<HadoopCatalog> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ void testAddColumnAutoIncrement() {
new SortOrder[0],
Indexes.EMPTY_INDEXES);

// Test add auto increment ,but not insert index. will failed.
// Test add auto increment ,but not insert index. will fail.
RuntimeException runtimeException =
assertThrows(
RuntimeException.class,
Expand Down
2 changes: 1 addition & 1 deletion catalogs/catalog-lakehouse-iceberg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testImplementation(libs.mockito.core)
// For test TestMultipleJDBCLoad, it was depended on testcontainers.mysql and testcontainers.postgresql)
// For test TestMultipleJDBCLoad, it was depended on testcontainers.mysql and testcontainers.postgresql
testImplementation(libs.mysql.driver)
testImplementation(libs.postgresql.driver)

Expand Down
2 changes: 1 addition & 1 deletion clients/client-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation(project(":common"))
implementation(libs.protobuf.java.util) {
exclude("com.google.guava", "guava")
.because("Brings in Guava for Andriod, which we don't want (and breaks multimaps).")
.because("Brings in Guava for Android, which we don't want (and breaks multimaps).")
}
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.apache.gravitino.tag.TagOperations;

/**
* Apache Gravitino Client for an user to interact with the Gravitino API, allowing the client to
* Apache Gravitino Client for a user to interact with the Gravitino API, allowing the client to
* list, load, create, and alter Catalog.
*
* <p>It uses an underlying {@link RESTClient} to send HTTP requests and receive responses from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Audit auditInfo() {
}

/**
* Creates a new Builder for constructing an User DTO.
* Creates a new Builder for constructing a User DTO.
*
* @return A new Builder instance.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@EqualsAndHashCode
public class LiteralDTO implements Literal<String>, FunctionArg {

/** A instance of LiteralDTO with a value of "NULL" and a data type of Types.NullType.get(). */
/** An instance of LiteralDTO with a value of "NULL" and a data type of Types.NullType.get(). */
public static final LiteralDTO NULL = new LiteralDTO("NULL", Types.NullType.get());

private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static ErrorResponse alreadyExists(String type, String message, Throwable
}

/**
* Create a new non empty error instance of {@link ErrorResponse}.
* Create a new non-empty error instance of {@link ErrorResponse}.
*
* @param type The type of the error.
* @param message The message of the error.
Expand All @@ -236,7 +236,7 @@ public static ErrorResponse nonEmpty(String type, String message) {
}

/**
* Create a new non empty error instance of {@link ErrorResponse}.
* Create a new non-empty error instance of {@link ErrorResponse}.
*
* @param type The type of the error.
* @param message The message of the error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public static TagDTO toDTO(Tag tag, Optional<Boolean> inherited) {
}

/**
* Converts a Expression to an FunctionArg DTO.
* Converts an Expression to an FunctionArg DTO.
*
* @param expression The expression to be converted.
* @return The expression DTO.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private static String[] getStringArray(ArrayNode node) {
}

/**
* Get a int value from a JSON node property.
* Get an int value from a JSON node property.
*
* @param property The property name.
* @param node The JSON node.
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/org/apache/gravitino/rest/RESTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static String stripTrailingSlash(String path) {
}

/**
* Encode a map of form data into an URL encoded string.
* Encode a map of form data into a URL encoded string.
*
* @param formData The form data to encode.
* @return The URL encoded form data string.
Expand All @@ -79,7 +79,7 @@ public static String encodeFormData(Map<?, ?> formData) {
}

/**
* Decode an URL encoded form data string into a map.
* Decode a URL encoded form data string into a map.
*
* @param formString The URL encoded form data string.
* @return The decoded form data map.
Expand Down Expand Up @@ -110,7 +110,7 @@ public static String encodeString(String toEncode) {
}

/**
* Decode an URL encoded string.
* Decode a URL encoded string.
*
* @param encoded The URL encoded string to decode.
* @return The decoded string.
Expand Down
2 changes: 1 addition & 1 deletion conf/gravitino-iceberg-rest-server.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ gravitino.iceberg-rest.requestHeaderSize = 131072
gravitino.iceberg-rest.responseHeaderSize = 131072

# THE CONFIGURATION FOR Iceberg catalog backend
# The Iceberg catalog backend, it's recommanded to change to hive or jdbc
# The Iceberg catalog backend, it's recommended to change to hive or jdbc
gravitino.iceberg-rest.catalog-backend = memory
# The warehouse directory of Iceberg catalog
gravitino.iceberg-rest.warehouse = /tmp/
2 changes: 1 addition & 1 deletion conf/gravitino.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ gravitino.iceberg-rest.classpath = iceberg-rest-server/libs, iceberg-rest-server
gravitino.iceberg-rest.host = 0.0.0.0
# Iceberg REST service http port
gravitino.iceberg-rest.httpPort = 9001
# The backend Iceberg catalog for Iceberg REST service, it's recommanded to change to hive or jdbc
# The backend Iceberg catalog for Iceberg REST service, it's recommended to change to hive or jdbc
gravitino.iceberg-rest.catalog-backend = memory
# The warehouse directory of Iceberg catalog for Iceberg REST service
gravitino.iceberg-rest.warehouse = /tmp/
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public boolean deleteRange(KvRange kvRange) throws IOException {
public List<Pair<byte[], byte[]>> scan(KvRange scanRange) throws IOException {
// Why we need to change the end key? Because we use the transaction id to construct a row key
// Assuming the end key is 'a' and the value of endInclusive is true, if we want to scan the
// value of key a, then we need to change the end key to 'b' and set the value of endInclusive
// value of key 'a', then we need to change the end key to 'b' and set the value of endInclusive
// to false.
byte[] end = scanRange.getEnd();
boolean endInclude = scanRange.isEndInclusive();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void insertGroup() throws IOException {
Sets.newHashSet(role1.name(), role2.name()),
Sets.newHashSet(actualOverwriteGroup2.roleNames()));

// insert overwrite user with 1 roles
// insert overwrite user with 1 role
RoleEntity role3 =
createRoleEntity(
RandomIdGenerator.INSTANCE.nextId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void insertUser() throws IOException {
Sets.newHashSet(role1.name(), role2.name()),
Sets.newHashSet(actualOverwriteUser2.roleNames()));

// insert overwrite user with 1 roles
// insert overwrite user with 1 role
RoleEntity role3 =
createRoleEntity(
RandomIdGenerator.INSTANCE.nextId(),
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ license: "This software is licensed under the Apache License version 2."

## Public key

- A openly shared key used for verification, encryption, or other operations intended for public knowledge.
- An openly shared key used for verification, encryption, or other operations intended for public knowledge.

## Representational State Transfer (REST)

Expand Down
2 changes: 1 addition & 1 deletion docs/jdbc-doris-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import TabItem from '@theme/TabItem';

## Introduction

Apache Gravitino provides the ability to manage [Apache Doris](https://doris.apache.org/) metadata through JDBC connection..
Apache Gravitino provides the ability to manage [Apache Doris](https://doris.apache.org/) metadata through JDBC connection.

:::caution
Gravitino saves some system information in schema and table comments, like
Expand Down
2 changes: 1 addition & 1 deletion docs/manage-table-partition-using-gravitino.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Each list in the lists must have the same length. The values in each list must c
</Tabs>

You can add a partition to a partitioned table by sending a `POST` request to the `/api/metalakes/{metalake_name}/catalogs/{catalog_name}/schemas/{schema_name}/tables/{partitioned_table_name}/partitions` endpoint or by using the Gravitino Java client.
The following is an example of adding a identity partition to a Hive partitioned table:
The following is an example of adding an identity partition to a Hive partitioned table:

<Tabs groupId='language' queryString>
<TabItem value="shell" label="Shell">
Expand Down
2 changes: 1 addition & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Refer to the "Additional JSSE Standard Names" section of the [Java security guid

### Example

You can follow the steps to set up a HTTPS server.
You can follow the steps to set up an HTTPS server.

1. Prerequisite

Expand Down
2 changes: 1 addition & 1 deletion docs/table-partitioning-bucketing-sort-order-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Indexes.of(IndexType.PRIMARY_KEY, "PRIMARY", new String[][]{{"col_1"}, {"col_2"}
</TabItem>
</Tabs>

The following is an example of creating a index table:
The following is an example of creating an index table:

<Tabs groupId='language' queryString>
<TabItem value="shell" label="Shell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.apache.hadoop.hive.conf.HiveConf;

/**
* The GravitinoHiveCatalog class is a implementation of the BaseCatalog class that is used to proxy
* the HiveCatalog class.
* The GravitinoHiveCatalog class is an implementation of the BaseCatalog class that is used to
* proxy the HiveCatalog class.
*/
public class GravitinoHiveCatalog extends BaseCatalog {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static void ignoreUnconsumedKeys(
}

/**
* Creates a utility that helps validating options for a {@link CatalogFactory}.
* Creates a utility that helps to validate options for a {@link CatalogFactory}.
*
* <p>Note: This utility checks for left-over options in the final step.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void buildOutputAndErrorStreamData(boolean mergeStreams) throws IOExcept

sbInStream.append(tempSB);
if (tempSB.length() > 0) {
// set flag to know that we read something and there may be moire data, even if process
// set flag to know that we read something and there may be more data, even if process
// already exited
outputProduced = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface OverwriteDefaultConfig {
/**
* Returns key value pairs to overwrite the config which are not set explicitly.
*
* @return an Map of Config key and value pairs
* @return a Map of Config key and value pairs
*/
Map<String, String> getOverwriteDefaultConfig();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ private List<SparkTableInfo.SparkColumnInfo> getIcebergSimpleTableColumn() {

/**
* Here we build a new `createIcebergSql` String for creating a table with a field of timestamp
* type to create the year/month,etc partitions
* type to create the year/month,etc. partitions
*/
private String getCreateIcebergSimpleTableString(String tableName) {
return String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.function.Function;

/**
* This class is reference to Trino source code io.trino.plugin.base.TypeDeserializer, It use to
* This class is reference to Trino source code io.trino.plugin.base.TypeDeserializer, It uses to
* handle Type serialization
*/
public final class TypeDeserializer extends FromStringDeserializer<Type> {
Expand Down
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
> **Requirements**
>
> Please make sure you use the node's LTS version
> Before installing the **node_modules**, make sure you have files starting with a **dot(.eslintrc, .env etc..)**
> Before installing the **node_modules**, make sure you have files starting with a **dot(.eslintrc, .env etc.)**
## Installation

Expand Down

0 comments on commit 4a590f8

Please sign in to comment.