You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2023/01/07 12:04:08 UTC

[doris] branch master updated: add Q&A to jdbc external table (#15680)

This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new ae1a77e034 add Q&A to jdbc external table (#15680)
ae1a77e034 is described below

commit ae1a77e034e404bcf9515a9507c21846d56f5e8f
Author: yongkang.zhong <zh...@qq.com>
AuthorDate: Sat Jan 7 20:04:02 2023 +0800

    add Q&A to jdbc external table (#15680)
---
 .../docs/ecosystem/external-table/jdbc-of-doris.md | 38 +++++++++++++++++++---
 .../docs/ecosystem/external-table/jdbc-of-doris.md | 27 +++++++++++++++
 2 files changed, 60 insertions(+), 5 deletions(-)

diff --git a/docs/en/docs/ecosystem/external-table/jdbc-of-doris.md b/docs/en/docs/ecosystem/external-table/jdbc-of-doris.md
index cc74970c50..075544dca7 100644
--- a/docs/en/docs/ecosystem/external-table/jdbc-of-doris.md
+++ b/docs/en/docs/ecosystem/external-table/jdbc-of-doris.md
@@ -261,17 +261,45 @@ There are different data types among different databases. Here is a list of the
 
 1. Besides mysql, Oracle, PostgreSQL, SQL Server and ClickHouse support more databases
 
-At present, Doris only adapts to MySQL, Oracle, PostgreSQL, SQL Server and ClickHouse.  And planning to adapt other databases. In principle, any database that supports JDBC access can be accessed through the JDBC facade. If you need to access other appearances, you are welcome to modify the code and contribute to Doris.
+   At present, Doris only adapts to MySQL, Oracle, PostgreSQL, SQL Server and ClickHouse.  And planning to adapt other databases. In principle, any database that supports JDBC access can be accessed through the JDBC facade. If you need to access other appearances, you are welcome to modify the code and contribute to Doris.
 
 2. Read the Emoji expression on the surface of MySQL, and there is garbled code
 
-When Doris makes a JDBC appearance connection, because the default utf8 code in MySQL is utf8mb3, it cannot represent Emoji expressions that require 4-byte coding. Here, you need to set the code of the corresponding column to utf8mb4, set the server code to utf8mb4, and do not configure characterencoding in the JDBC URL when creating the MySQL appearance (this attribute does not support utf8mb4. If non utf8mb4 is configured, the expression cannot be written. Therefore, it should be left  [...]
+   When Doris makes a JDBC appearance connection, because the default utf8 code in MySQL is utf8mb3, it cannot represent Emoji expressions that require 4-byte coding. Here, you need to set the code of the corresponding column to utf8mb4, set the server code to utf8mb4, and do not configure characterencoding in the JDBC URL when creating the MySQL appearance (this attribute does not support utf8mb4. If non utf8mb4 is configured, the expression cannot be written. Therefore, it should be le [...]
 
 3. When reading the mysql table about DateTime="0000:00:00 00:00:00", an error is reported: "CAUSED BY: DataReadException: Zero date value prohibited"
 
-This is because the default handling of this illegal DateTime in JDBC is to throw an exception. You can control this behavior through the parameter zeroDateTimeBehavior
-Optional parameters: EXCEPTION, CONVERT_TO_NULL and ROUND are respectively abnormal error reports, converted to NULL values and converted to "0001-01-01 00:00:00";
-You can add: "jdbc_url"="jdbc: mysql://IP:PORT/doris_test?zeroDateTimeBehavior=convertToNull "
+   This is because the default handling of this illegal DateTime in JDBC is to throw an exception. You can control this behavior through the parameter zeroDateTimeBehavior
+   Optional parameters: EXCEPTION, CONVERT_TO_NULL and ROUND are respectively abnormal error reports, converted to NULL values and converted to "0001-01-01 00:00:00";
+   You can add: "jdbc_url"="jdbc: mysql://IP:PORT/doris_test?zeroDateTimeBehavior=convertToNull "
+
+4. When reading the mysql table or other  external table loading the class failed
+
+   Such as the following exceptions:
+   failed to load driver class com.mysql.jdbc.driver in either of hikariconfig class loader
+   This is because when resource is created, driver_class is incorrectly entered. Therefore, it needs to be correctly entered. For example, if the preceding example is case sensitive, enter as `"driver_class" = "com.mysql.jdbc.Driver"`
+
+5. When reading mysql communications link failure
+
+   If the following error occurs:
+   ```
+   ERROR 1105 (HY000): errCode = 2, detailMessage = PoolInitializationException: Failed to initialize pool: Communications link failure
+    
+   The last packet successfully received from the server was 7 milliseconds ago.  The last packet sent successfully to the server was 4 milliseconds ago.
+   CAUSED BY: CommunicationsException: Communications link failure
+    
+   The last packet successfully received from the server was 7 milliseconds ago.  The last packet sent successfully to the server was 4 milliseconds ago.
+   CAUSED BY: SSLHandshakeExcepti
+   ```
+   You can view the be.out logs of the be
+   If the following information is included:
+   ```
+   WARN: Establishing SSL connection without server's identity verification is not recommended. 
+   According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. 
+   For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. 
+   You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
+   ```
+   You can add the JDBC connection string at the end of the jdbc_url where the resource is created `?useSSL=false` ,like `"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/test?useSSL=false"`
 
 ```
 Configuration items can be modified globally
diff --git a/docs/zh-CN/docs/ecosystem/external-table/jdbc-of-doris.md b/docs/zh-CN/docs/ecosystem/external-table/jdbc-of-doris.md
index 66812308e2..71836b55be 100644
--- a/docs/zh-CN/docs/ecosystem/external-table/jdbc-of-doris.md
+++ b/docs/zh-CN/docs/ecosystem/external-table/jdbc-of-doris.md
@@ -274,6 +274,33 @@ PROPERTIES (
    可选参数为:EXCEPTION,CONVERT_TO_NULL,ROUND, 分别为异常报错,转为NULL值,转为"0001-01-01 00:00:00";
    可在url中添加:"jdbc_url"="jdbc:mysql://IP:PORT/doris_test?zeroDateTimeBehavior=convertToNull" 
 
+4. 读取mysql外表或其他外表时,出现加载类失败
+   
+   如以下异常:
+   failed to load driver class com.mysql.jdbc.driver in either of hikariconfig class loader
+   这是因为在创建resource时,填写的driver_class不正确,需要正确填写,如上方例子为大小写问题,应填写为 `"driver_class" = "com.mysql.jdbc.Driver"`
+
+5. 读取mysql问题出现通信链路异常
+   
+   如果出现如下报错:
+   ```
+    ERROR 1105 (HY000): errCode = 2, detailMessage = PoolInitializationException: Failed to initialize pool: Communications link failure
+    
+    The last packet successfully received from the server was 7 milliseconds ago.  The last packet sent successfully to the server was 4 milliseconds ago.
+    CAUSED BY: CommunicationsException: Communications link failure
+    
+    The last packet successfully received from the server was 7 milliseconds ago.  The last packet sent successfully to the server was 4 milliseconds ago.
+    CAUSED BY: SSLHandshakeExcepti
+   ```
+   可查看be的be.out日志
+   如果包含以下信息:
+   ```
+   WARN: Establishing SSL connection without server's identity verification is not recommended. 
+   According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. 
+   For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. 
+   You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
+   ```
+   可在创建resource的jdbc_url把JDBC连接串最后增加 `?useSSL=false` ,如 `"jdbc_url" = "jdbc:mysql://127.0.0.1:3306/test?useSSL=false"`
 
 ```
 可全局修改配置项


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