You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/08 04:25:04 UTC

[GitHub] [doris] morningman commented on a diff in pull request #14924: [Docs](jdbc catalog) add docs for jdbc catalog

morningman commented on code in PR #14924:
URL: https://github.com/apache/doris/pull/14924#discussion_r1042909640


##########
docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-CATALOG.md:
##########
@@ -75,6 +76,19 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name
    );
    ```
 
+3. 新建数据目录 jdbc
+
+	```sql
+	CREATE CATALOG jdbc PROPERTIES (
+		"type"="jdbc",
+		"jdbc.user"="root",
+		"jdbc.password"="123456",
+		"jdbc.jdbc_url" = "jdbc:mysql://127.0.0.1:13396/demo",
+		"jdbc.driver_url" = "file:/mnt/disk2/ftw/tools/jar/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar",
+		"jdbc.driver_class" = "com.mysql.jdbc.Driver"

Review Comment:
   增加一个 http 的示例



##########
docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-CATALOG.md:
##########
@@ -75,6 +76,19 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name
    );
    ```
 
+3. 新建数据目录 jdbc
+
+	```sql
+	CREATE CATALOG jdbc PROPERTIES (
+		"type"="jdbc",
+		"jdbc.user"="root",
+		"jdbc.password"="123456",
+		"jdbc.jdbc_url" = "jdbc:mysql://127.0.0.1:13396/demo",
+		"jdbc.driver_url" = "file:/mnt/disk2/ftw/tools/jar/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar",

Review Comment:
   ```suggestion
   		"jdbc.driver_url" = "file:/path/to/mysql-connector-java-5.1.47.jar",
   ```



##########
docs/zh-CN/docs/ecosystem/external-table/multi-catalog.md:
##########
@@ -371,6 +372,100 @@ mysql> select * from test;
     
 之后,可以像正常的 Hive MetaStore 一样,访问 DLF 下的元数据。 
 
+### 连接JDBC
+
+以下示例,用于创建一个名为 jdbc 的 Catalog, 通过jdbc 连接指定的Mysql。
+jdbc Catalog会根据`jdbc.jdbc_url` 来连接指定的数据库(示例中是`jdbc::mysql`, 所以连接MYSQL数据库),当前只支持MYSQL数据库类型。
+```sql
+CREATE CATALOG jdbc PROPERTIES (
+    "type"="jdbc",
+    "jdbc.user"="root",
+    "jdbc.password"="123456",
+    "jdbc.jdbc_url" = "jdbc:mysql://127.0.0.1:13396/demo",
+    "jdbc.driver_url" = "file:/mnt/disk2/ftw/tools/jar/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar",
+    "jdbc.driver_class" = "com.mysql.jdbc.Driver"
+);
+```

Review Comment:
   这里添加下说明:
   1. 如果是本地文件,jar应该如何部署,最终会放置在哪里。
   2. 如果是http文件,jar应该如何部署,最终会放置在哪里。还有比如 http 的话,是否这个地址不能失效?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org