You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/12/19 08:05:14 UTC
[doris] 01/02: [fix](broker-load) fix broker load with hdfs failed to get right file type (#15138)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 980eca18fe5a8032084226d6b882d973b8042049
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Mon Dec 19 16:00:58 2022 +0800
[fix](broker-load) fix broker load with hdfs failed to get right file type (#15138)
---
.../doris/planner/external/FileGroupInfo.java | 1 +
.../suites/jdbc_p0/test_jdbc_query_mysql.groovy | 26 +++++++++++++++++++---
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
index f3cb9a19f9..0a2f3edb8e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
@@ -99,6 +99,7 @@ public class FileGroupInfo {
this.filesAdded = filesAdded;
this.strictMode = strictMode;
this.loadParallelism = loadParallelism;
+ this.fileType = brokerDesc.getFileType();
}
// for stream load
diff --git a/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy b/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
index d704e30b73..a1d0b0e41e 100644
--- a/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
+++ b/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
@@ -266,14 +266,14 @@ suite("test_jdbc_query_mysql", "p0") {
sql """ drop table if exists ${exMysqlTable} """
sql """ drop table if exists ${inDorisTable} """
sql """ CREATE EXTERNAL TABLE `${exMysqlTable}` (
- `id` int(11) not NULL,
+ `id` bigint not NULL,
`apply_id` varchar(32) NULL,
`begin_value` string NULL,
`operator` varchar(32) NULL,
`operator_name` varchar(32) NULL,
`state` varchar(8) NULL,
`sub_state` varchar(8) NULL,
- `state_count` smallint(5) NULL,
+ `state_count` int NULL,
`create_time` datetime NULL
) ENGINE=JDBC
COMMENT "JDBC Mysql 外部表"
@@ -894,7 +894,7 @@ suite("test_jdbc_query_mysql", "p0") {
sql """ drop table if exists ${exMysqlTypeTable} """
sql """
CREATE EXTERNAL TABLE ${exMysqlTypeTable} (
- `id` bigint NOT NULL,
+ `id` int NOT NULL,
`count_value` varchar(100) NULL
) ENGINE=JDBC
COMMENT "JDBC Mysql 外部表"
@@ -934,6 +934,26 @@ suite("test_jdbc_query_mysql", "p0") {
order_qt_sql111 """ SELECT rank() OVER () FROM (SELECT k8 FROM $jdbcMysql57Table1 LIMIT 10) as t LIMIT 3 """
order_qt_sql112 """ SELECT k7, count(DISTINCT k8) FROM $jdbcMysql57Table1 WHERE k8 > 110 GROUP BY GROUPING SETS ((), (k7)) """
+ // test for type check
+ sql """ drop table if exists ${exMysqlTypeTable} """
+ sql """
+ CREATE EXTERNAL TABLE ${exMysqlTypeTable} (
+ `id` bigint NOT NULL,
+ `count_value` varchar(100) NULL
+ ) ENGINE=JDBC
+ COMMENT "JDBC Mysql 外部表"
+ PROPERTIES (
+ "resource" = "$jdbcResourceMysql57",
+ "table" = "ex_tb2",
+ "table_type"="mysql"
+ );
+ """
+
+ test {
+ sql """select * from ${exMysqlTypeTable} order by id"""
+ exception "Fail to convert jdbc type of java.lang.Integer to doris type BIGINT on column: id"
+ }
+
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org