Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2879] feat(docs): Add doc for Doris catalog (#3051)

Kang494c2df9a326
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index 174f3fa961..9a22ffd567 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -24,7 +24,7 @@ This document lists the maintainers of the Project. Maintainers may be added onc
All contributions to the project must be reviewed by **AT LEAST** one maintainer before merging.
For larger changes, it is recommended to have more than one reviewer. In particular, if you are
-working on a area you are not familiar with, it is recommended to ask for review from that area by
+working on an area you are not familiar with, it is recommended to ask for review from that area by
using `git log --format=full <filename>` to see who committed the most.
## When to commit/merge a pull request
@@ -38,12 +38,12 @@ those involved with conversations to be resolved.
Changes pushed to the main branch on Gravitino cannot be **removed**, that is, we can't do
force-push to it. So please don't add any test commits or anything like that. If the PR is
merged by mistake, please using `git revert` to revert the commit, not `git reset` or anything
-like this.
+like that.
Please use the "Squash and merge" option when merging a PR. This will keep the commit history
clean and meaningful.
-Gravitino use "issue" to track the project progress. So make sure each PR has a related issue, if
+Gravitino uses "issue" to track the project progresses. So make sure each PR has a related issue, if
not, please ask the PR author to create one. Unless this PR is a trivial one, like fixing a typo or
something like that, all PRs should have related issues.
@@ -65,7 +65,7 @@ something like that, all PRs should have related issues.
## Policy on backporting bug fixes
Gravitino maintains several branches for different versions, so backporting bug fixes is a
-common and necessary operation for maintenance release. The decision point is when you have a
+common and necessary operation for maintenance releases. The decision point is when you have a
bug fix, and it's not clear whether it is worth backporting or not. Here is the general policy:
For those bug fixes we should backport:
diff --git a/docs/assets/webui/props-doris.png b/docs/assets/webui/props-doris.png
new file mode 100644
index 0000000000..d412b96d6f
Binary files /dev/null and b/docs/assets/webui/props-doris.png differ
diff --git a/docs/gravitino-server-config.md b/docs/gravitino-server-config.md
index 751d6435dd..90d0b7af57 100644
--- a/docs/gravitino-server-config.md
+++ b/docs/gravitino-server-config.md
@@ -128,6 +128,7 @@ The following table lists the catalog specific properties and their default path
| `lakehouse-iceberg` | [Lakehouse Iceberg catalog properties](lakehouse-iceberg-catalog.md#catalog-properties) | `catalogs/lakehouse-iceberg/conf/lakehouse-iceberg.conf` |
| `jdbc-mysql` | [MySQL catalog properties](jdbc-mysql-catalog.md#catalog-properties) | `catalogs/jdbc-mysql/conf/jdbc-mysql.conf` |
| `jdbc-postgresql` | [PostgreSQL catalog properties](jdbc-postgresql-catalog.md#catalog-properties) | `catalogs/jdbc-postgresql/conf/jdbc-postgresql.conf` |
+| `jdbc-doris` | [Doris catalog properties](jdbc-doris-catalog.md#catalog-properties) | `catalogs/jdbc-doris/conf/jdbc-doris.conf` |
:::info
The Gravitino server automatically adds the catalog properties configuration directory to classpath.
diff --git a/docs/index.md b/docs/index.md
index 857002186f..efcd2dc487 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -70,6 +70,7 @@ Gravitino currently supports the following catalogs:
* [**Hive catalog**](./apache-hive-catalog.md)
* [**MySQL catalog**](./jdbc-mysql-catalog.md)
* [**PostgreSQL catalog**](./jdbc-postgresql-catalog.md)
+* [**Doris catalog**](./jdbc-doris-catalog.md)
**Fileset catalogs:**
@@ -105,6 +106,7 @@ Gravitino supports different catalogs to manage the metadata in different source
* [Hive catalog](./apache-hive-catalog.md): a complete guide to using Gravitino to manage Apache Hive data.
* [MySQL catalog](./jdbc-mysql-catalog.md): a complete guide to using Gravitino to manage MySQL data.
* [PostgreSQL catalog](./jdbc-postgresql-catalog.md): a complete guide to using Gravitino to manage PostgreSQL data.
+* [Doris catalog](./jdbc-doris-catalog.md): a complete guide to using Gravitino to manage Doris data.
* [Hadoop catalog](./hadoop-catalog.md): a complete guide to using Gravitino to manage fileset
using Hadoop Compatible File System (HCFS).
diff --git a/docs/jdbc-doris-catalog.md b/docs/jdbc-doris-catalog.md
new file mode 100644
index 0000000000..f23e92704e
--- /dev/null
+++ b/docs/jdbc-doris-catalog.md
@@ -0,0 +1,177 @@
+---
+title: "Apache Doris catalog"
+slug: /jdbc-doris-catalog
+keywords:
+- jdbc
+- Apache Doris
+- metadata
+license: "Copyright 2024 Datastrato Pvt Ltd.
+This software is licensed under the Apache License version 2."
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+## Introduction
+
+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
+`(From Gravitino, DO NOT EDIT: gravitino.v1.uid1078334182909406185)`, please don't change or remove this message.
+:::
+
+## Catalog
+
+### Catalog capabilities
+
+- Gravitino catalog corresponds to the Doris instance.
+- Supports metadata management of Doris (1.2.x).
+- Supports table index.
+- Supports [column default value](./manage-relational-metadata-using-gravitino.md#table-column-default-value).
+
+### Catalog properties
+
+You can pass to a Doris data source any property that isn't defined by Gravitino by adding
+`gravitino.bypass.` prefix as a catalog property. For example, catalog property
+`gravitino.bypass.maxWaitMillis` will pass `maxWaitMillis` to the data source property.
+
+You can check the relevant data source configuration in
+[data source properties](https://commons.apache.org/proper/commons-dbcp/configuration.html) for
+more details.
+
+Here are the catalog properties defined in Gravitino for Doris catalog:
+
+| Configuration item | Description | Default value | Required | Since Version |
+|----------------------|-------------------------------------------------------------------------------------|---------------|----------|---------------|
+| `jdbc-url` | JDBC URL for connecting to the database. For example, `jdbc:mysql://localhost:9030` | (none) | Yes | 0.5.0 |
+| `jdbc-driver` | The driver of the JDBC connection. For example, `com.mysql.jdbc.Driver`. | (none) | Yes | 0.5.0 |
+| `jdbc-user` | The JDBC user name. | (none) | Yes | 0.5.0 |
+| `jdbc-password` | The JDBC password. | (none) | Yes | 0.5.0 |
+| `jdbc.pool.min-size` | The minimum number of connections in the pool. `2` by default. | `2` | No | 0.5.0 |
+| `jdbc.pool.max-size` | The maximum number of connections in the pool. `10` by default. | `10` | No | 0.5.0 |
+
+Before using the Doris Catalog, you must download the corresponding JDBC driver to the `catalogs/jdbc-doris/libs` directory.
+Gravitino doesn't package the JDBC driver for Doris due to licensing issues.
+
+### Catalog operations
+
+Refer to [Manage Relational Metadata Using Gravitino](./manage-relational-metadata-using-gravitino.md#catalog-operations) for more details.
+
+## Schema
+
+### Schema capabilities
+
+- Gravitino's schema concept corresponds to the Doris database.
+- Supports creating schema.
+- Supports dropping schema.
+
+### Schema properties
+
+- Support schema properties, including Doris database properties and user-defined properties.
+
+### Schema operations
+
+Please refer to
+[Manage Relational Metadata Using Gravitino](./manage-relational-metadata-using-gravitino.md#schema-operations) for more details.
+
+## Table
+
+### Table capabilities
+
+- Gravitino's table concept corresponds to the Doris table.
+- Supports index.
+- Supports [column default value](./manage-relational-metadata-using-gravitino.md#table-column-default-value).
+
+#### Table column types
+
+| Gravitino Type | Doris Type |
+|----------------|------------|
+| `Boolean` | `Boolean` |
+| `Byte` | `TinyInt` |
+| `Short` | `SmallInt` |
+| `Integer` | `Int` |
+| `Long` | `BigInt` |
+| `Float` | `Float` |
+| `Double` | `Double` |
+| `Decimal` | `Decimal` |
+| `Date` | `Date` |
+| `Timestamp` | `Datetime` |
+| `VarChar` | `VarChar` |
+| `FixedChar` | `Char` |
+| `String` | `String` |
+
+Doris doesn't support Gravitino `Fixed` `Struct` `List` `Map` `Timestamp_tz` `IntervalDay` `IntervalYear` `Union` `UUID` type.
+The data types other than those listed above are mapped to Gravitino's
+**[Unparsed Type](./manage-relational-metadata-using-gravitino.md#unparsed-type)** that
+represents an unresolvable data type since 0.5.0.
+
+#### Table column auto-increment
+
+Unsupported for now.
+
+### Table properties
+
+- Doris supports table properties, and you can set them in the table properties.
+- Only supports Doris table properties and doesn't support user-defined properties.
+
+### Table indexes
+
+- Supports PRIMARY_KEY
+
+ Please be aware that the index can only apply to a single column.
+
+ <Tabs>
+ <TabItem value="json" label="Json">
+
+ ```json
+ {
+ "indexes": [
+ {
+ "indexType": "primary_key",
+ "name": "PRIMARY",
+ "fieldNames": [["id"]]
+ }
+ ]
+ }
+ ```
+
+ </TabItem>
+ <TabItem value="java" label="Java">
+
+ ```java
+ Index[] indexes = new Index[] {
+ Indexes.of(IndexType.PRIMARY_KEY, "PRIMARY", new String[][]{{"id"}})
+ }
+ ```
+
+ </TabItem>
+ </Tabs>
+
+### Table operations
+
+Please refer to [Manage Relational Metadata Using Gravitino](./manage-relational-metadata-using-gravitino.md#table-operations) for more details.
+
+#### Alter table operations
+
+Gravitino supports these table alteration operations:
+
+- `RenameTable`
+- `UpdateComment`
+- `AddColumn`
+- `DeleteColumn`
+- `UpdateColumnType`
+- `UpdateColumnPosition`
+- `UpdateColumnComment`
+- `SetProperty`
+
+Please be aware that:
+
+ - Not all table alteration operations can be processed in batches.
+ - Schema changes, such as adding/modifying/dropping columns can be processed in batches.
+ - Supports modifying multiple column comments at the same time.
+ - Doesn't support modifying the column type and column comment at the same time.
+ - The schema alteration in Doris is asynchronous. You might get an outdated schema if you
+ execute a schema query immediately after the alteration. It is recommended to pause briefly
+ after the schema alteration. Gravitino will add the schema alteration status into
+ the schema information in the upcoming version to solve this problem.
diff --git a/docs/jdbc-mysql-catalog.md b/docs/jdbc-mysql-catalog.md
index 6ec1bf615e..aba936b28c 100644
--- a/docs/jdbc-mysql-catalog.md
+++ b/docs/jdbc-mysql-catalog.md
@@ -33,7 +33,7 @@ Gravitino saves some system information in schema and table comment, like `(From
### Catalog properties
-You can pass to a MySQL data source any property that isn't defined by Gravitino by adding `gravitino.bypass` prefix as a catalog property. For example, catalog property `gravitino.bypass.maxWaitMillis` will pass `maxWaitMillis` to the data source property.
+You can pass to a MySQL data source any property that isn't defined by Gravitino by adding `gravitino.bypass.` prefix as a catalog property. For example, catalog property `gravitino.bypass.maxWaitMillis` will pass `maxWaitMillis` to the data source property.
Check the relevant data source configuration in [data source properties](https://commons.apache.org/proper/commons-dbcp/configuration.html)
diff --git a/docs/jdbc-postgresql-catalog.md b/docs/jdbc-postgresql-catalog.md
index 6b85373db5..5f673ecac6 100644
--- a/docs/jdbc-postgresql-catalog.md
+++ b/docs/jdbc-postgresql-catalog.md
@@ -32,7 +32,7 @@ Gravitino saves some system information in schema and table comment, like `(From
### Catalog properties
-Any property that isn't defined by Gravitino can pass to MySQL data source by adding `gravitino.bypass` prefix as a catalog property. For example, catalog property `gravitino.bypass.maxWaitMillis` will pass `maxWaitMillis` to the data source property.
+Any property that isn't defined by Gravitino can pass to MySQL data source by adding `gravitino.bypass.` prefix as a catalog property. For example, catalog property `gravitino.bypass.maxWaitMillis` will pass `maxWaitMillis` to the data source property.
You can check the relevant data source configuration in [data source properties](https://commons.apache.org/proper/commons-dbcp/configuration.html)
If you use JDBC catalog, you must provide `jdbc-url`, `jdbc-driver`, `jdbc-database`, `jdbc-user` and `jdbc-password` to catalog properties.
diff --git a/docs/lakehouse-iceberg-catalog.md b/docs/lakehouse-iceberg-catalog.md
index 1c8923b82f..a5d1b67b4b 100644
--- a/docs/lakehouse-iceberg-catalog.md
+++ b/docs/lakehouse-iceberg-catalog.md
@@ -39,7 +39,7 @@ Builds with Hadoop 2.10.x, there may be compatibility issues when accessing Hado
| `uri` | The URI configuration of the Iceberg catalog. `thrift://127.0.0.1:9083` or `jdbc:postgresql://127.0.0.1:5432/db_name` or `jdbc:mysql://127.0.0.1:3306/metastore_db`. | (none) | Yes | 0.2.0 |
| `warehouse` | Warehouse directory of catalog. `file:///user/hive/warehouse-hive/` for local fs or `hdfs://namespace/hdfs/path` for HDFS. | (none) | Yes | 0.2.0 |
-Any properties not defined by Gravitino with `gravitino.bypass` prefix will pass to Iceberg catalog properties and HDFS configuration. For example, if specify `gravitino.bypass.list-all-tables`, `list-all-tables` will pass to Iceberg catalog properties.
+Any properties not defined by Gravitino with `gravitino.bypass.` prefix will pass to Iceberg catalog properties and HDFS configuration. For example, if specify `gravitino.bypass.list-all-tables`, `list-all-tables` will pass to Iceberg catalog properties.
#### JDBC catalog
diff --git a/docs/manage-relational-metadata-using-gravitino.md b/docs/manage-relational-metadata-using-gravitino.md
index 2e44f98ffc..028ee5cf33 100644
--- a/docs/manage-relational-metadata-using-gravitino.md
+++ b/docs/manage-relational-metadata-using-gravitino.md
@@ -21,6 +21,7 @@ For more details, please refer to the related doc.
- [**Apache Hive**](./apache-hive-catalog.md)
- [**MySQL**](./jdbc-mysql-catalog.md)
- [**PostgreSQL**](./jdbc-postgresql-catalog.md)
+- [**Doris**](./jdbc-doris-catalog.md)
- [**Apache Iceberg**](./lakehouse-iceberg-catalog.md)
Assuming:
@@ -93,6 +94,7 @@ Currently, Gravitino supports the following catalog providers:
| `lakehouse-iceberg` | [Iceberg catalog property](./lakehouse-iceberg-catalog.md#catalog-properties) |
| `jdbc-mysql` | [MySQL catalog property](./jdbc-mysql-catalog.md#catalog-properties) |
| `jdbc-postgresql` | [PostgreSQL catalog property](./jdbc-postgresql-catalog.md#catalog-properties) |
+| `jdbc-doris` | [Doris catalog property](./jdbc-doris-catalog.md#catalog-properties) |
### Load a catalog
@@ -305,6 +307,7 @@ Currently, Gravitino supports the following schema property:
| `lakehouse-iceberg` | [Iceberg scheme property](./lakehouse-iceberg-catalog.md#schema-properties) |
| `jdbc-mysql` | [MySQL schema property](./jdbc-mysql-catalog.md#schema-properties) |
| `jdbc-postgresql` | [PostgreSQL schema property](./jdbc-postgresql-catalog.md#schema-properties) |
+| `jdbc-doris` | [Doris schema property](./jdbc-doris-catalog.md#schema-properties) |
### Load a schema
@@ -727,6 +730,7 @@ The following is the table property that Gravitino supports:
| `lakehouse-iceberg` | [Iceberg table property](./lakehouse-iceberg-catalog.md#table-properties) | [Iceberg type mapping](./lakehouse-iceberg-catalog.md#table-column-types) |
| `jdbc-mysql` | [MySQL table property](./jdbc-mysql-catalog.md#table-properties) | [MySQL type mapping](./jdbc-mysql-catalog.md#table-column-types) |
| `jdbc-postgresql` | [PostgreSQL table property](./jdbc-postgresql-catalog.md#table-properties) | [PostgreSQL type mapping](./jdbc-postgresql-catalog.md#table-column-types) |
+| `doris` | [Doris table property](./jdbc-doris-catalog.md#table-properties) | [Doris type mapping](./jdbc-doris-catalog.md#table-column-types) |
#### Table partitioning, bucketing, sort ordering and indexes
diff --git a/docs/webui.md b/docs/webui.md
index 0800f7c712..a758aa4ea0 100644
--- a/docs/webui.md
+++ b/docs/webui.md
@@ -222,6 +222,19 @@ Creating a catalog requires these fields:
|jdbc-password|The JDBC password |
|jdbc-database|e.g. `pg_database` |
+ </TabItem>
+ <TabItem value='doris' label='Doris'>
+ Follow the [JDBC Doris catalog](jdbc-doris-catalog) document
+
+ <Image img={require('./assets/webui/props-doris.png')} style={{ width: 480 }} />
+
+ |Key |Description |
+ |-------------|-----------------------------------------------------|
+ |jdbc-driver |e.g. `com.mysql.jdbc.Driver` |
+ |jdbc-url |e.g. `jdbc:mysql://localhost:9030` |
+ |jdbc-user |The JDBC user name |
+ |jdbc-password|The JDBC password |
+
</TabItem>
</Tabs>