World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#6708] docs: Add documentation for the GravitinoJdbcCatalog in Flink connector (#6772)
yangyang zhong74f17c4afc36
diff --git a/docs/flink-connector/flink-catalog-jdbc.md b/docs/flink-connector/flink-catalog-jdbc.mdnew file mode 100644index 0000000000..3d78f21131--- /dev/null+++ b/docs/flink-connector/flink-catalog-jdbc.md@@ -0,0 +1,121 @@+---+title: "Flink connector jdbc catalog"+slug: /flink-connector/flink-catalog-jdbc+keyword: flink connector jdbc catalog+license: "This software is licensed under the Apache License version 2."+---++This document provides a comprehensive guide on configuring and using Apache Gravitino Flink connector to access the JDBC catalog managed by the Gravitino server.++## Capabilities++### Supported JDBC Types++* MYSQL++## Getting Started++### Prerequisites++Place the following JAR files in the lib directory of your Flink installation:++- [flink-connector-jdbc-${flinkJdbcConnectorVersion}.jar](https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/connectors/table/jdbc/)+- [gravitino-flink-connector-runtime-1.18_2.12-${gravitino-version}.jar](https://mvnrepository.com/artifact/org.apache.gravitino/gravitino-flink-connector-runtime-1.18)+- JDBC driver++### SQL Example++```sql+-- Suppose jdbc_catalog is the JDBC catalog name managed by Gravitino++USE CATALOG jdbc_catalog;++SHOW DATABASES;+-- +------------------++-- | database name |+-- +------------------++-- | mysql |+-- +------------------+++CREATE DATABASE jdbc_database;+-- [INFO] Execute statement succeed.++SHOW DATABASES;+-- +------------------++-- | database name |+-- +------------------++-- | mysql |+-- | jdbc_database |+-- +------------------+++USE jdbc_database;+-- [INFO] Execute statement succeed.++SET 'execution.runtime-mode' = 'batch';+-- [INFO] Execute statement succeed.++SET 'sql-client.execution.result-mode' = 'tableau';+-- [INFO] Execute statement succeed.++USE jdbc_database;+-- [INFO] Execute statement succeed.++SHOW TABLES;+-- Empty set++CREATE TABLE jdbc_table_a (+ aa BIGINT NOT NULL PRIMARY KEY NOT ENFORCED,+ bb BIGINT+);+-- [INFO] Execute statement succeed.++SHOW TABLES;+-- +--------------++-- | table name |+-- +--------------++-- | jdbc_table_a |+-- +--------------++-- 1 row in set++INSERT INTO jdbc_table_a VALUES(1,2);++SELECT * FROM jdbc_table_a;+-- +----+----++-- | aa | bb |+-- +----+----++-- | 1 | 2 |+-- +----+----++-- 1 row in set++INSERT INTO jdbc_table_a VALUES(2,3);+-- [INFO] Submitting SQL update statement to the cluster...+-- [INFO] SQL update statement has been successfully submitted to the cluster:+-- Job ID: bc320828d49b97b684ed9f622f1b8aca++INSERT INTO jdbc_table_a VALUES(1,4);+-- [INFO] Submitting SQL update statement to the cluster...+-- [INFO] SQL update statement has been successfully submitted to the cluster:+-- Job ID: bc320828d49b97b684ed9f622f1b8aca++SELECT * FROM jdbc_table_a;+-- +----+----++-- | aa | bb |+-- +----+----++-- | 1 | 4 |+-- | 2 | 3 |+-- +----+----++-- 2 rows in set++```++## Catalog properties++Gravitino Flink connector will transform below property names which are defined in catalog properties to Flink JDBC connector configuration.++| Gravitino catalog property name | Flink JDBC connector configuration | Description | Since Version |+|:--------------------------------|------------------------------------|--------------------------------|------------------|+| `jdbc-url` | `base-url` | JDBC URL for MYSQL | 0.9.0-incubating |+| `username` | `username` | Username of MySQL account | 0.9.0-incubating |+| `password` | `password` | Password of the account | 0.9.0-incubating |+| `flink.bypass.default-database` | `default-database` | Default database to connect to | 0.9.0-incubating |+diff --git a/docs/flink-connector/flink-connector.md b/docs/flink-connector/flink-connector.mdindex e6109bb378..84067ecbeb 100644--- a/docs/flink-connector/flink-connector.md+++ b/docs/flink-connector/flink-connector.md@@ -13,9 +13,10 @@ This capability allows users to perform federation queries, accessing data from## Capabilities1. Supports [Hive catalog](flink-catalog-hive.md)-1. Supports [Iceberg catalog](flink-catalog-iceberg.md)-1. Supports [Paimon catalog](flink-catalog-paimon.md)-2. Supports most DDL and DML SQLs.+2. Supports [Iceberg catalog](flink-catalog-iceberg.md)+3. Supports [Paimon catalog](flink-catalog-paimon.md)+4. Supports [Jdbc catalog](flink-catalog-jdbc.md)+5. Supports most DDL and DML SQLs.## Requirement