This is an automated email from the ASF dual-hosted git repository.
morningman 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 687989692b5 [fix](jdbc catalog) fix and add mysql and doris extremum
test (#41679)
687989692b5 is described below
commit 687989692b5356f374718e5fcd8e13eaffbcd8a7
Author: zy-kkk <[email protected]>
AuthorDate: Sun Oct 13 20:17:50 2024 +0800
[fix](jdbc catalog) fix and add mysql and doris extremum test (#41679)
1、add mysql jdbc catalog extremum test
2、mysql jdbc catalog time data outside the 24-hour range can be read
3、add doris jdbc catalog extremum test
4、fix doris jdbc catalog char type max size match
5、fix doris jdbc catalog nested array read
Legacy:
Doris float extreme values are incorrect 3.4028235e+38, -3.4028235e+38
Correct values should be 3.4028234e+38, -3.4028234e+38. The incorrect
value will exceed the Java float range, so ignore this test and add it
after it is fixed
This PR also followup #40122
Adds requiredColumnSize() and requiredDecimalDigits() methods to
JdbcFieldSchema, improving error handling by throwing exceptions when
values are absent.
---
.../docker-compose/mysql/init/03-create-table.sql | 153 +++++++++++++++
.../docker-compose/mysql/init/04-insert.sql | 37 ++++
.../org/apache/doris/jdbc/BaseJdbcExecutor.java | 2 +-
.../org/apache/doris/jdbc/MySQLJdbcExecutor.java | 40 +++-
.../datasource/jdbc/client/JdbcMySQLClient.java | 23 +--
.../datasource/jdbc/util/JdbcFieldSchema.java | 14 +-
.../jdbc/test_mariadb_jdbc_catalog.out | 8 +-
.../jdbc/test_mysql_jdbc_catalog.out | 33 ++--
.../type_test/ctas/test_mysql_all_types_ctas.out | 22 +++
.../select/test_doris_all_types_select.out | 104 +++++++++++
.../select/test_mysql_all_types_select.out | 117 ++++++++++++
.../type_test/tvf/test_mysql_all_types_tvf.out | 104 +++++++++++
.../ctas/test_mysql_all_types_ctas.groovy | 61 ++++++
.../select/test_doris_all_types_select.groovy | 206 +++++++++++++++++++++
.../select/test_mysql_all_types_select.groovy | 52 ++++++
.../type_test/tvf/test_mysql_all_types_tvf.groovy | 48 +++++
16 files changed, 978 insertions(+), 46 deletions(-)
diff --git a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
index 312a0a25fac..9c29d2fb00c 100644
--- a/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/03-create-table.sql
@@ -352,3 +352,156 @@ col_int_undef_signed2 int
create table doris_test.text_push (pk varchar(10));
+
+create table doris_test.all_types_nullable (
+ `tinyint_u` tinyint unsigned,
+ `smallint_u` smallint unsigned,
+ `mediumint_u` mediumint unsigned,
+ `int_u` int unsigned,
+ `bigint_u` bigint unsigned,
+ `decimal1_u` decimal unsigned,
+ `decimal2_u` decimal(9, 2) unsigned,
+ `decimal3_u` decimal(18, 5) unsigned,
+ `decimal4_u` decimal(38, 10) unsigned,
+ `decimal5_u` decimal(65, 30) unsigned,
+ `double_u` double unsigned,
+ `float_u` float unsigned,
+ `boolean` boolean,
+ `tinyint` tinyint,
+ `smallint` smallint,
+ `mediumint` mediumint,
+ `int` int,
+ `bigint` bigint,
+ `double` double,
+ `float` float,
+ `decimal1` decimal,
+ `decimal2` decimal(9, 2),
+ `decimal3` decimal(18, 5) ,
+ `decimal4` decimal(38, 10),
+ `decimal5` decimal(65, 30),
+ `year` year,
+ `time1` time,
+ `time2` time(3),
+ `time3` time(6),
+ `date` date,
+ `datetime` datetime,
+ `timestamp1` timestamp null,
+ `timestamp2` timestamp(3) null,
+ `timestamp3` timestamp(6) null,
+ `char` char(5),
+ `varchar` varchar(10),
+ `text` text,
+ `blob` blob,
+ `json` json,
+ `set` set('Option1', 'Option2', 'Option3'),
+ `bit` bit(6),
+ `binary` binary(12),
+ `varbinary` varbinary(12),
+ `enum` enum('Value1', 'Value2', 'Value3')
+) engine=innodb charset=utf8;
+
+
+create table doris_test.all_types_non_nullable (
+ `tinyint_u` tinyint unsigned NOT NULL,
+ `smallint_u` smallint unsigned NOT NULL,
+ `mediumint_u` mediumint unsigned NOT NULL,
+ `int_u` int unsigned NOT NULL,
+ `bigint_u` bigint unsigned NOT NULL,
+ `decimal1_u` decimal unsigned NOT NULL,
+ `decimal2_u` decimal(9, 2) unsigned NOT NULL,
+ `decimal3_u` decimal(18, 5) unsigned NOT NULL,
+ `decimal4_u` decimal(38, 10) unsigned NOT NULL,
+ `decimal5_u` decimal(65, 30) unsigned NOT NULL,
+ `double_u` double unsigned NOT NULL,
+ `float_u` float unsigned NOT NULL,
+ `boolean` boolean NOT NULL,
+ `tinyint` tinyint NOT NULL,
+ `smallint` smallint NOT NULL,
+ `mediumint` mediumint NOT NULL,
+ `int` int NOT NULL,
+ `bigint` bigint NOT NULL,
+ `double` double NOT NULL,
+ `float` float NOT NULL,
+ `decimal1` decimal NOT NULL,
+ `decimal2` decimal(9, 2) NOT NULL,
+ `decimal3` decimal(18, 5) NOT NULL,
+ `decimal4` decimal(38, 10) NOT NULL,
+ `decimal5` decimal(65, 30) NOT NULL,
+ `year` year NOT NULL,
+ `time1` time NOT NULL,
+ `time2` time(3) NOT NULL,
+ `time3` time(6) NOT NULL,
+ `date` date NOT NULL,
+ `datetime` datetime NOT NULL,
+ `timestamp1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `timestamp2` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
+ `timestamp3` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
+ `char` char(5) NOT NULL,
+ `varchar` varchar(10) NOT NULL,
+ `text` text NOT NULL,
+ `blob` blob NOT NULL,
+ `json` json NOT NULL,
+ `set` set('Option1', 'Option2', 'Option3') NOT NULL,
+ `bit` bit(6) NOT NULL,
+ `binary` binary(12) NOT NULL,
+ `varbinary` varbinary(12) NOT NULL,
+ `enum` enum('Value1', 'Value2', 'Value3') NOT NULL
+) engine=innodb charset=utf8;
+
+
+create table doris_test.all_types_multi_block (
+ `tinyint_u` tinyint unsigned,
+ `smallint_u` smallint unsigned,
+ `mediumint_u` mediumint unsigned,
+ `int_u` int unsigned,
+ `bigint_u` bigint unsigned,
+ `decimal1_u` decimal unsigned,
+ `decimal2_u` decimal(9, 2) unsigned,
+ `decimal3_u` decimal(18, 5) unsigned,
+ `decimal4_u` decimal(38, 10) unsigned,
+ `decimal5_u` decimal(65, 30) unsigned,
+ `double_u` double unsigned,
+ `float_u` float unsigned,
+ `boolean` boolean,
+ `tinyint` tinyint,
+ `smallint` smallint,
+ `mediumint` mediumint,
+ `int` int,
+ `bigint` bigint,
+ `double` double,
+ `float` float,
+ `decimal1` decimal,
+ `decimal2` decimal(9, 2),
+ `decimal3` decimal(18, 5) ,
+ `decimal4` decimal(38, 10),
+ `decimal5` decimal(65, 30),
+ `year` year,
+ `time1` time,
+ `time2` time(3),
+ `time3` time(6),
+ `date` date,
+ `datetime` datetime,
+ `timestamp1` timestamp null,
+ `timestamp2` timestamp(3) null,
+ `timestamp3` timestamp(6) null,
+ `char` char(5),
+ `varchar` varchar(10),
+ `text` text,
+ `blob` blob,
+ `json` json,
+ `set` set('Option1', 'Option2', 'Option3'),
+ `bit` bit(6),
+ `binary` binary(12),
+ `varbinary` varbinary(12),
+ `enum` enum('Value1', 'Value2', 'Value3')
+) engine=innodb charset=utf8;
+
+
+CREATE TABLE doris_test.`t_varchar` (
+ `varchar_col` varchar(21844)
+);
+
+CREATE TABLE doris_test.`t_char` (
+ `char_col` char(255) COLLATE utf8_bin DEFAULT NULL
+);
+
diff --git a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
index 4580440e9bd..5784edaed5b 100644
--- a/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
+++ b/docker/thirdparties/docker-compose/mysql/init/04-insert.sql
@@ -1168,3 +1168,40 @@ insert into Doris.doris values ('doris');
insert into
doris_test.compoundpredicate_test(pk,col_int_undef_signed,col_int_undef_signed2)
values
(0,null,23868),(1,68,-18),(2,19030,-125),(3,16539,null),(4,null,null),(5,null,-127),(6,14680,-26424),(7,-22270,12722),(8,null,null),(9,null,null),(10,null,7744),(11,null,-94),(12,16970,95),(13,null,7023),(14,null,1),(15,3679,-11),(16,null,-1079),(17,-22,null),(18,30995,null),(19,null,-79);
insert into doris_test.text_push values('a'),('aa'),('aaa');
+
+insert into doris_test.all_types_nullable
+values(0,0,0,0,0, 0, 0.00, 0.00000, 0.0000000000,
0.000000000000000000000000000000,0,0,false,-128,-32768,-8388608,-2147483648,-9223372036854775808,-1.7976931348623157E+308,-3.4028234E+38,-9999999999,-9999999.99,-9999999999999.99999,-9999999999999999999999999999.9999999999,-99999999999999999999999999999999999.999999999999999999999999999999,1901,'-838:59:59','-838:59:59.000','-838:59:59.000000','1000-01-01','1000-01-01
00:00:00','1970-01-01 00:00:01','1970-01-01 00:00:01.000','1970-01-01 0 [...]
+(255,65535,16777215,4294967295,18446744073709551615,9999999999, 9999999.99,
9999999999999.99999, 9999999999999999999999999999.9999999999,
99999999999999999999999999999999999.999999999999999999999999999999,1.7976931348623157E+308,3.4028234E+38,true,127,32767,8388607,2147483647,9223372036854775807,1.7976931348623157E+308,3.4028234E+38,9999999999,9999999.99,9999999999999.99999,9999999999999999999999999999.9999999999,99999999999999999999999999999999999.999999999999999999999999999999,2155,'83
[...]
+(0,0,0,0,0, 0, 0.00, 0.00000, 0.0000000000, 0.000000000000000000000000000000,
0, 0, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1901, '00:00:00',
'00:00:00.000', '00:00:00.000000','1000-01-01','1000-01-01
00:00:00','1970-01-01 00:00:01','1970-01-01 00:00:01.000','1970-01-01
00:00:01.000000', '', '', '', '', '{}', '', b'', '', '', 'Value1'),
+(NULL,NULL,NULL,NULL,NULL, NULL, NULL, NULL, NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+insert into doris_test.all_types_non_nullable
+values(0,0,0,0,0, 0, 0.00, 0.00000, 0.0000000000,
0.000000000000000000000000000000,0,0,false,-128,-32768,-8388608,-2147483648,-9223372036854775808,-1.7976931348623157E+308,-3.4028234E+38,-9999999999,-9999999.99,-9999999999999.99999,-9999999999999999999999999999.9999999999,-99999999999999999999999999999999999.999999999999999999999999999999,1901,'-838:59:59','-838:59:59.000','-838:59:59.000000','1000-01-01','1000-01-01
00:00:00','1970-01-01 00:00:01','1970-01-01 00:00:01.000','1970-01-01 0 [...]
+(255,65535,16777215,4294967295,18446744073709551615,9999999999, 9999999.99,
9999999999999.99999, 9999999999999999999999999999.9999999999,
99999999999999999999999999999999999.999999999999999999999999999999,1.7976931348623157E+308,3.4028234E+38,true,127,32767,8388607,2147483647,9223372036854775807,1.7976931348623157E+308,3.4028234E+38,9999999999,9999999.99,9999999999999.99999,9999999999999999999999999999.9999999999,99999999999999999999999999999999999.999999999999999999999999999999,2155,'83
[...]
+(0,0,0,0,0, 0, 0.00, 0.00000, 0.0000000000, 0.000000000000000000000000000000,
0, 0, false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1901, '00:00:00',
'00:00:00.000', '00:00:00.000000','1000-01-01','1000-01-01
00:00:00','1970-01-01 00:00:01','1970-01-01 00:00:01.000','1970-01-01
00:00:01.000000', '', '', '', '', '{}', '', b'', '', '', 'Value1');
+
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_nullable;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_multi_block;
+insert into doris_test.all_types_multi_block select * from
doris_test.all_types_nullable;
+
+INSERT INTO doris_test.t_varchar (varchar_col) VALUES ('a');
+
+INSERT INTO doris_test.t_varchar (varchar_col) VALUES ('中');
+
+INSERT INTO doris_test.t_varchar (varchar_col) VALUES (REPEAT('a', 21844));
+
+INSERT INTO doris_test.t_varchar (varchar_col) VALUES (REPEAT('中', 21844));
+
+INSERT INTO doris_test.t_char (char_col) VALUES (REPEAT('a', 255));
+
+INSERT INTO doris_test.t_char (char_col) VALUES (REPEAT('中', 255));
+
diff --git
a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java
b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java
index 6e389926571..03e5ca1fa7c 100644
---
a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java
+++
b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/BaseJdbcExecutor.java
@@ -58,8 +58,8 @@ public abstract class BaseJdbcExecutor implements
JdbcExecutor {
private static final TBinaryProtocol.Factory PROTOCOL_FACTORY = new
TBinaryProtocol.Factory();
private HikariDataSource hikariDataSource = null;
private final byte[] hikariDataSourceLock = new byte[0];
- private JdbcDataSourceConfig config;
private Connection conn = null;
+ protected JdbcDataSourceConfig config;
protected PreparedStatement preparedStatement = null;
protected Statement stmt = null;
protected ResultSet resultSet = null;
diff --git
a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/MySQLJdbcExecutor.java
b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/MySQLJdbcExecutor.java
index 60f190f1291..e94f2b22298 100644
---
a/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/MySQLJdbcExecutor.java
+++
b/fe/be-java-extensions/jdbc-scanner/src/main/java/org/apache/doris/jdbc/MySQLJdbcExecutor.java
@@ -22,6 +22,7 @@ import org.apache.doris.common.jni.vec.ColumnType.Type;
import org.apache.doris.common.jni.vec.ColumnValueConverter;
import org.apache.doris.common.jni.vec.VectorTable;
import org.apache.doris.thrift.TJdbcOperation;
+import org.apache.doris.thrift.TOdbcTableType;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.MoreExecutors;
@@ -34,6 +35,7 @@ import java.math.BigInteger;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Types;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatterBuilder;
@@ -133,8 +135,18 @@ public class MySQLJdbcExecutor extends BaseJdbcExecutor {
case VARCHAR:
case ARRAY:
return resultSet.getObject(columnIndex + 1, String.class);
- case STRING:
- return resultSet.getObject(columnIndex + 1);
+ case STRING: {
+ int jdbcType = resultSetMetaData.getColumnType(columnIndex
+ 1);
+ // If it is a time type in mysql, or use mysql driver
connect mariadb
+ // We need to obtain the string directly to ensure that we
can obtain a time other than 24 hours.
+ // If it is another database, such as oceanbase, this
processing will lose precision information,
+ // so the original processing method will be maintained
for the time being.
+ if (jdbcType == Types.TIME && config.getTableType() ==
TOdbcTableType.MYSQL) {
+ return resultSet.getString(columnIndex + 1);
+ } else {
+ return resultSet.getObject(columnIndex + 1);
+ }
+ }
default:
throw new IllegalArgumentException("Unsupported column
type: " + type.getType());
}
@@ -192,6 +204,9 @@ public class MySQLJdbcExecutor extends BaseJdbcExecutor {
}
private Object convertArray(Object input, ColumnType columnType) {
+ if (input == null) {
+ return null;
+ }
java.lang.reflect.Type listType = getListTypeForArray(columnType);
if (columnType.getType() == Type.BOOLEAN) {
List<?> list = gson.fromJson((String) input, List.class);
@@ -228,10 +243,25 @@ public class MySQLJdbcExecutor extends BaseJdbcExecutor {
throw new IllegalArgumentException("Cannot convert " +
item + " to LocalDateTime.");
}
}).collect(Collectors.toList());
+ } else if (columnType.getType() == Type.LARGEINT) {
+ List<?> list = gson.fromJson((String) input, List.class);
+ return list.stream().map(item -> {
+ if (item instanceof Number) {
+ return new BigDecimal(item.toString()).toBigInteger();
+ } else if (item instanceof String) {
+ return new BigDecimal((String) item).toBigInteger();
+ } else {
+ throw new IllegalArgumentException("Cannot convert " +
item + " to BigInteger.");
+ }
+ }).collect(Collectors.toList());
} else if (columnType.getType() == Type.ARRAY) {
- List<?> list = gson.fromJson((String) input, listType);
- return list.stream()
- .map(item -> convertArray(gson.toJson(item),
columnType.getChildTypes().get(0)))
+ ColumnType childType = columnType.getChildTypes().get(0);
+ List<?> rawList = gson.fromJson((String) input, List.class);
+ return rawList.stream()
+ .map(element -> {
+ String elementJson = gson.toJson(element);
+ return convertArray(elementJson, childType);
+ })
.collect(Collectors.toList());
} else {
return gson.fromJson((String) input, listType);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java
index 5624392de14..465a3c152ac 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/client/JdbcMySQLClient.java
@@ -195,8 +195,8 @@ public class JdbcMySQLClient extends JdbcClient {
case "BIGINT":
return Type.LARGEINT;
case "DECIMAL": {
- int precision = fieldSchema.getColumnSize().orElse(0) + 1;
- int scale = fieldSchema.getDecimalDigits().orElse(0);
+ int precision = fieldSchema.requiredColumnSize() + 1;
+ int scale = fieldSchema.requiredDecimalDigits();
return createDecimalOrStringType(precision, scale);
}
case "DOUBLE":
@@ -233,7 +233,7 @@ public class JdbcMySQLClient extends JdbcClient {
case "DATETIME": {
// mysql can support microsecond
// use columnSize to calculate the precision of
timestamp/datetime
- int columnSize = fieldSchema.getColumnSize().orElse(0);
+ int columnSize = fieldSchema.requiredColumnSize();
int scale = columnSize > 19 ? columnSize - 20 : 0;
if (scale > 6) {
scale = 6;
@@ -248,18 +248,18 @@ public class JdbcMySQLClient extends JdbcClient {
case "DOUBLE":
return Type.DOUBLE;
case "DECIMAL": {
- int precision = fieldSchema.getColumnSize().orElse(0);
- int scale = fieldSchema.getDecimalDigits().orElse(0);
+ int precision = fieldSchema.requiredColumnSize();
+ int scale = fieldSchema.requiredDecimalDigits();
return createDecimalOrStringType(precision, scale);
}
case "CHAR":
ScalarType charType =
ScalarType.createType(PrimitiveType.CHAR);
- charType.setLength(fieldSchema.getColumnSize().orElse(0));
+ charType.setLength(fieldSchema.requiredColumnSize());
return charType;
case "VARCHAR":
return
ScalarType.createVarcharType(fieldSchema.getColumnSize().orElse(0));
case "BIT":
- if (fieldSchema.getColumnSize().orElse(0) == 1) {
+ if (fieldSchema.requiredColumnSize() == 1) {
return Type.BOOLEAN;
} else {
return ScalarType.createStringType();
@@ -360,8 +360,8 @@ public class JdbcMySQLClient extends JdbcClient {
return Type.DOUBLE;
case "DECIMAL":
case "DECIMALV3": {
- int precision = fieldSchema.getColumnSize().orElse(0);
- int scale = fieldSchema.getDecimalDigits().orElse(0);
+ int precision = fieldSchema.requiredColumnSize();
+ int scale = fieldSchema.requiredDecimalDigits();
return createDecimalOrStringType(precision, scale);
}
case "DATE":
@@ -377,11 +377,12 @@ public class JdbcMySQLClient extends JdbcClient {
return ScalarType.createDatetimeV2Type(scale);
}
case "CHAR":
+ case "CHARACTER":
ScalarType charType =
ScalarType.createType(PrimitiveType.CHAR);
- charType.setLength(fieldSchema.getColumnSize().orElse(0));
+ charType.setLength(fieldSchema.requiredColumnSize());
return charType;
case "VARCHAR":
- return
ScalarType.createVarcharType(fieldSchema.getColumnSize().orElse(0));
+ return
ScalarType.createVarcharType(fieldSchema.requiredColumnSize());
case "STRING":
case "TEXT":
case "JSON":
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/util/JdbcFieldSchema.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/util/JdbcFieldSchema.java
index 90850ffca21..7d643fac25c 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/util/JdbcFieldSchema.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/jdbc/util/JdbcFieldSchema.java
@@ -47,7 +47,6 @@ public class JdbcFieldSchema {
protected int charOctetLength;
protected boolean isAllowNull;
-
public JdbcFieldSchema(JdbcFieldSchema other) {
this.columnName = other.columnName;
this.dataType = other.dataType;
@@ -65,7 +64,7 @@ public class JdbcFieldSchema {
this.dataType = getInteger(rs, "DATA_TYPE").orElseThrow(() -> new
IllegalStateException("DATA_TYPE is null"));
this.dataTypeName = Optional.ofNullable(rs.getString("TYPE_NAME"));
this.columnSize = getInteger(rs, "COLUMN_SIZE");
- this.decimalDigits = getInteger(rs, "DECIMAL_DIGITS");
+ this.decimalDigits = getInteger(rs, "DECIMAL_DIGITS");
this.numPrecRadix = rs.getInt("NUM_PREC_RADIX");
this.isAllowNull = rs.getInt("NULLABLE") !=
DatabaseMetaData.columnNoNulls;
this.remarks = rs.getString("REMARKS");
@@ -77,7 +76,7 @@ public class JdbcFieldSchema {
this.dataType = getInteger(rs, "DATA_TYPE").orElseThrow(() -> new
IllegalStateException("DATA_TYPE is null"));
this.dataTypeName =
Optional.ofNullable(dataTypeOverrides.getOrDefault(columnName,
rs.getString("TYPE_NAME")));
this.columnSize = getInteger(rs, "COLUMN_SIZE");
- this.decimalDigits = getInteger(rs, "DECIMAL_DIGITS");
+ this.decimalDigits = getInteger(rs, "DECIMAL_DIGITS");
this.numPrecRadix = rs.getInt("NUM_PREC_RADIX");
this.isAllowNull = rs.getInt("NULLABLE") != 0;
this.remarks = rs.getString("REMARKS");
@@ -92,6 +91,14 @@ public class JdbcFieldSchema {
this.decimalDigits = Optional.of(metaData.getScale(columnIndex));
}
+ public int requiredColumnSize() {
+ return columnSize.orElseThrow(() -> new IllegalStateException("column
size not present"));
+ }
+
+ public int requiredDecimalDigits() {
+ return decimalDigits.orElseThrow(() -> new
IllegalStateException("decimal digits not present"));
+ }
+
protected static Optional<Integer> getInteger(ResultSet resultSet, String
columnLabel)
throws SQLException {
int value = resultSet.getInt(columnLabel);
@@ -101,4 +108,3 @@ public class JdbcFieldSchema {
return Optional.of(value);
}
}
-
diff --git
a/regression-test/data/external_table_p0/jdbc/test_mariadb_jdbc_catalog.out
b/regression-test/data/external_table_p0/jdbc/test_mariadb_jdbc_catalog.out
index b6817f090f5..ee029c8e0a2 100644
--- a/regression-test/data/external_table_p0/jdbc/test_mariadb_jdbc_catalog.out
+++ b/regression-test/data/external_table_p0/jdbc/test_mariadb_jdbc_catalog.out
@@ -37,8 +37,8 @@ processlist
2023-06-17T10:00 2023-06-17T10:00:01 2023-06-17T10:00:02.200
2023-06-17T10:00:03.330 2023-06-17T10:00:04.444 2023-06-17T10:00:05.555500
2023-06-17T10:00:06.666660 2023-06-17T10:00:06.666666
-- !mysql_all_types --
-\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345600
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.567 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
-201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345600 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.567 text1
0x48656C6C6F20576F726C64 {"name": "Alice", "age": 30, "city": "London"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
-202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345600 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.567 text2
0xE86F6C6C6F20576F726C67 {"name": "Gaoxin", "age": 18, "city":
"ChongQing"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
-203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.567 text3 0xE86F6C6C6F20576F726C67 {"name":
"ChenQi", "age": 24, "city": "ChongQing"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
+\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345600
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
+201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345600 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.5678 text1
0x48656C6C6F20576F726C64 {"name": "Alice", "age": 30, "city": "London"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
+202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345600 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.5678 text2
0xE86F6C6C6F20576F726C67 {"name": "Gaoxin", "age": 18, "city":
"ChongQing"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
+203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.5678 text3 0xE86F6C6C6F20576F726C67 {"name":
"ChenQi", "age": 24, "city": "ChongQing"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
diff --git
a/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out
b/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out
index d697c8e5e60..b028dd4ccbb 100644
--- a/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out
+++ b/regression-test/data/external_table_p0/jdbc/test_mysql_jdbc_catalog.out
@@ -259,22 +259,22 @@ mysql
{"k1":"v1", "k2":"v2"}
-- !mysql_all_types --
-\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.567 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
-201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.567 text1
0x48656C6C6F20576F726C64 {"age": 30, "city": "London", "name": "Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
-202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.567 text2
0xE86F6C6C6F20576F726C67 {"age": 18, "city": "ChongQing", "name":
"Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
-203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.567 text3 0xE86F6C6C6F20576F726C67 {"age": 24,
"city": "ChongQing", "name": "ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
+\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
+201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.5678 text1
0x48656C6C6F20576F726C64 {"age": 30, "city": "London", "name": "Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
+202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.5678 text2
0xE86F6C6C6F20576F726C67 {"age": 18, "city": "ChongQing", "name":
"Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
+203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.5678 text3 0xE86F6C6C6F20576F726C67 {"age": 24,
"city": "ChongQing", "name": "ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
-- !select_insert_all_types --
-\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.567 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
-201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.567 text1
0x48656C6C6F20576F726C64 {"age":30,"city":"London","name":"Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
-202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.567 text2
0xE86F6C6C6F20576F726C67 {"age":18,"city":"ChongQing","name":"Gaoxin"}
Option1,Option2 0x2F 0x58676C6C6F00000000000000 0x88656C6C9F Value3
-203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.567 text3 0xE86F6C6C6F20576F726C67
{"age":24,"city":"ChongQing","name":"ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
+\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
+201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.5678 text1
0x48656C6C6F20576F726C64 {"age":30,"city":"London","name":"Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
+202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.5678 text2
0xE86F6C6C6F20576F726C67 {"age":18,"city":"ChongQing","name":"Gaoxin"}
Option1,Option2 0x2F 0x58676C6C6F00000000000000 0x88656C6C9F Value3
+203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.5678 text3 0xE86F6C6C6F20576F726C67
{"age":24,"city":"ChongQing","name":"ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
-- !ctas --
-\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.567 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
-201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.567 text1
0x48656C6C6F20576F726C64 {"age": 30, "city": "London", "name": "Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
-202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.567 text2
0xE86F6C6C6F20576F726C67 {"age": 18, "city": "ChongQing", "name":
"Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
-203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.567 text3 0xE86F6C6C6F20576F726C67 {"age": 24,
"city": "ChongQing", "name": "ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
+\N 302 \N 502 602 4.14159 \N 6.14159 \N -124
-302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700
2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N
09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F
\N 0x88656C6C9F Value3
+201 301 401 501 601 3.14159 4.1415926 5.14159 1
-123 -301 2012 -401 -501 -601 2012-10-30
2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145
-5.1400000001 -6.1400 row1 line1 09:09:09.5678 text1
0x48656C6C6F20576F726C64 {"age": 30, "city": "London", "name": "Alice"}
Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2
+202 302 402 502 602 4.14159 5.1415926 6.14159 0
-124 -302 2013 -402 -502 -602 2012-11-01
2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145
-6.1400000001 -7.1400 row2 line2 09:11:09.5678 text2
0xE86F6C6C6F20576F726C67 {"age": 18, "city": "ChongQing", "name":
"Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000
0x88656C6C9F Value3
+203 303 403 503 603 7.14159 8.1415926 9.14159 0
\N -402 2017 -602 -902 -1102 2012-11-02 \N
2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3
line3 09:11:09.5678 text3 0xE86F6C6C6F20576F726C67 {"age": 24,
"city": "ChongQing", "name": "ChenQi"} Option2 0x2F
0x58676C6C6F00000000000000 \N Value1
-- !ctas_desc --
bigint bigint Yes false \N NONE
@@ -442,12 +442,3 @@ t2 text Yes false \N NONE
varchar varchar(65533) Yes true \N
int_u bigint Yes false \N NONE
--- !sql --
-int_u bigint Yes true \N
-text varchar(65533) Yes true \N
-t2 varchar(65533) Yes false \N NONE
-
--- !sql --
-varchar varchar(65533) Yes true \N
-int_u bigint Yes false \N NONE
-
diff --git
a/regression-test/data/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.out
b/regression-test/data/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.out
new file mode 100644
index 00000000000..4aa5a2aced2
--- /dev/null
+++
b/regression-test/data/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.out
@@ -0,0 +1,22 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !select_all_types_nullable --
+\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
+-- !select_all_types_non_nullable --
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
+-- !select_varchar --
+a
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[...]
+中
+中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中�
��中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
[...]
+
+-- !select_char --
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
+
diff --git
a/regression-test/data/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.out
b/regression-test/data/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.out
new file mode 100644
index 00000000000..597362ba461
--- /dev/null
+++
b/regression-test/data/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.out
@@ -0,0 +1,104 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !desc_all_types_nullable --
+bool_col boolean Yes true \N
+tinyint_col tinyint Yes true \N
+smallint_col smallint Yes true \N
+int_col int Yes true \N
+bigint_col bigint Yes true \N
+largeint_col largeint Yes true \N
+float_col float Yes true \N
+double_col double Yes true \N
+decimal_col decimal(38,10) Yes true \N
+date_col date Yes true \N
+datetime_col1 datetime Yes true \N
+datetime_col2 datetime(3) Yes true \N
+datetime_col3 datetime(6) Yes true \N
+char_col character(255) Yes true \N
+varchar_col varchar(65533) Yes true \N
+string_col text Yes true \N
+json_col text Yes true \N
+
+-- !select_all_types_nullable --
+\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N
+false -128 -32768 -2147483648 -9223372036854775808
-170141183460469231731687303715884105727 -1.7976931348623157E308
-9999999999999999999999999999.9999999999 0000-01-01
0000-01-01T00:00 0000-01-01T00:00 0000-01-01T00:00 a
a -string {"a":0}
+true 127 32767 2147483647 9223372036854775807
170141183460469231731687303715884105727 1.7976931348623157E308
9999999999999999999999999999.9999999999 9999-12-31 9999-12-31T23:59:59
9999-12-31T23:59:59.999 9999-12-31T23:59:59.999999
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaa [...]
+
+-- !desc_all_types_non_nullable --
+bool_col boolean No true \N
+tinyint_col tinyint No true \N
+smallint_col smallint No true \N
+int_col int No true \N
+bigint_col bigint No true \N
+largeint_col largeint No true \N
+float_col float No true \N
+double_col double No true \N
+decimal_col decimal(38,10) No true \N
+date_col date No true \N
+datetime_col1 datetime No true \N
+datetime_col2 datetime(3) No true \N
+datetime_col3 datetime(6) No true \N
+char_col character(255) No true \N
+varchar_col varchar(65533) No true \N
+string_col text No true \N
+json_col text No true \N
+
+-- !select_all_types_non_nullable --
+false -128 -32768 -2147483648 -9223372036854775808
-170141183460469231731687303715884105727 -1.7976931348623157E308
-9999999999999999999999999999.9999999999 0000-01-01
0000-01-01T00:00 0000-01-01T00:00 0000-01-01T00:00 a
a -string {"a":0}
+true 127 32767 2147483647 9223372036854775807
170141183460469231731687303715884105727 1.7976931348623157E308
9999999999999999999999999999.9999999999 9999-12-31 9999-12-31T23:59:59
9999-12-31T23:59:59.999 9999-12-31T23:59:59.999999
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaa [...]
+
+-- !desc_bitmap_hll --
+k int Yes true \N
+bitmap_c bitmap No true \N
+hll_c hll No true \N
+
+-- !select_bitmap_hll --
+1 1 1
+2 1 1
+3 1 1
+4 1 1
+
+-- !desc_arr_types_test --
+int_col int Yes true \N
+arr_bool_col array<boolean> Yes true \N
+arr_tinyint_col array<tinyint> Yes true \N
+arr_smallint_col array<smallint> Yes true \N
+arr_int_col array<int> Yes true \N
+arr_bigint_col array<bigint> Yes true \N
+arr_largeint_col array<largeint> Yes true \N
+arr_float_col array<float> Yes true \N
+arr_double_col array<double> Yes true \N
+arr_decimal1_col array<decimal(10,5)> Yes true \N
+arr_decimal2_col array<decimal(30,10)> Yes true \N
+arr_date_col array<date> Yes true \N
+arr_datetime_col array<datetime(3)> Yes true \N
+arr_char_col array<char(10)> Yes true \N
+arr_varchar_col array<varchar(10)> Yes true \N
+arr_string_col array<text> Yes true \N
+
+-- !select_arr_types_test --
+1 [1] [1] [1] [1] [1] [1] [1] [1]
[1.00000] [1.0000000000] ["2021-01-01"] ["2021-01-01 00:00:00.000"]
["a"] ["a"] ["a"]
+2 \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N
+
+-- !desc_arr_nesting_types_test --
+int_col int Yes true \N
+arr_arr_bool_col array<array<boolean>> Yes true \N
+arr_arr_tinyint_col array<array<tinyint>> Yes true \N
+arr_arr_smallint_col array<array<smallint>> Yes true \N
+arr_arr_int_col array<array<int>> Yes true \N
+arr_arr_bigint_col array<array<bigint>> Yes true \N
+arr_arr_largeint_col array<array<largeint>> Yes true \N
+arr_arr_float_col array<array<float>> Yes true \N
+arr_arr_double_col array<array<double>> Yes true \N
+arr_arr_decimal1_col array<array<decimal(10,5)>> Yes true \N
+arr_arr_decimal2_col array<array<decimal(30,10)>> Yes true \N
+arr_arr_date_col array<array<date>> Yes true \N
+arr_arr_datetime_col array<array<datetime(3)>> Yes true \N
+arr_arr_char_col array<array<char(10)>> Yes true \N
+arr_arr_varchar_col array<array<varchar(10)>> Yes true \N
+arr_arr_string_col array<array<text>> Yes true \N
+
+-- !select_arr_nesting_types_test --
+1 [[1]] [[1]] [[1]] [[1]] [[1]] [[1]] [[1]] [[1]]
[[1.00000]] [[1.0000000000]] [["2021-01-01"]] [["2021-01-01
00:00:00.000"]] [["a"]] [["a"]] [["a"]]
+2 [[1], [1]] [[1], [1]] [[1], [1]] [[1], [1]] [[1],
[1]] [[1], [1]] [[1], [1]] [[1], [1]] [[1.00000],
[1.00000]] [[1.0000000000], [1.0000000000]] [["2021-01-01"],
["2021-01-01"]] [["2021-01-01 00:00:00.000"], ["2021-01-01
00:00:00.000"]] [["a"], ["a"]] [["a"], ["a"]] [["a"], ["a"]]
+3 \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N
+
diff --git
a/regression-test/data/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.out
b/regression-test/data/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.out
new file mode 100644
index 00000000000..8362d8ffee5
--- /dev/null
+++
b/regression-test/data/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.out
@@ -0,0 +1,117 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !desc_all_types_null --
+tinyint_u smallint Yes true \N
+smallint_u int Yes true \N
+mediumint_u int Yes true \N
+int_u bigint Yes true \N
+bigint_u largeint Yes true \N
+decimal1_u decimal(11,0) Yes true \N
+decimal2_u decimal(10,2) Yes true \N
+decimal3_u decimal(19,5) Yes true \N
+decimal4_u text Yes true \N
+decimal5_u text Yes true \N
+double_u double Yes true \N
+float_u float Yes true \N
+boolean tinyint Yes true \N
+tinyint tinyint Yes true \N
+smallint smallint Yes true \N
+mediumint int Yes true \N
+int int Yes true \N
+bigint bigint Yes true \N
+double double Yes true \N
+float float Yes true \N
+decimal1 decimal(10,0) Yes true \N
+decimal2 decimal(9,2) Yes true \N
+decimal3 decimal(18,5) Yes true \N
+decimal4 decimal(38,10) Yes true \N
+decimal5 text Yes true \N
+year smallint Yes true \N
+time1 text Yes true \N
+time2 text Yes true \N
+time3 text Yes true \N
+date date Yes true \N
+datetime datetime Yes true \N
+timestamp1 datetime Yes true \N
+timestamp2 datetime(3) Yes true \N
+timestamp3 datetime(6) Yes true \N
+char char(5) Yes true \N
+varchar varchar(10) Yes true \N
+text text Yes true \N
+blob text Yes true \N
+json text Yes true \N
+set text Yes true \N
+bit text Yes true \N
+binary text Yes true \N
+varbinary text Yes true \N
+enum text Yes true \N
+
+-- !select_all_types_null --
+\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
+-- !desc_all_types_non_null --
+tinyint_u smallint No true \N
+smallint_u int No true \N
+mediumint_u int No true \N
+int_u bigint No true \N
+bigint_u largeint No true \N
+decimal1_u decimal(11,0) No true \N
+decimal2_u decimal(10,2) No true \N
+decimal3_u decimal(19,5) No true \N
+decimal4_u text No true \N
+decimal5_u text No true \N
+double_u double No true \N
+float_u float No true \N
+boolean tinyint No true \N
+tinyint tinyint No true \N
+smallint smallint No true \N
+mediumint int No true \N
+int int No true \N
+bigint bigint No true \N
+double double No true \N
+float float No true \N
+decimal1 decimal(10,0) No true \N
+decimal2 decimal(9,2) No true \N
+decimal3 decimal(18,5) No true \N
+decimal4 decimal(38,10) No true \N
+decimal5 text No true \N
+year smallint No true \N
+time1 text No true \N
+time2 text No true \N
+time3 text No true \N
+date date No true \N
+datetime datetime No true \N
+timestamp1 datetime No true \N
+timestamp2 datetime(3) No true \N
+timestamp3 datetime(6) No true \N
+char char(5) No true \N
+varchar varchar(10) No true \N
+text text No true \N
+blob text No true \N
+json text No true \N
+set text No true \N
+bit text No true \N
+binary text No true \N
+varbinary text No true \N
+enum text No true \N
+
+-- !select_all_types_non_null --
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
+-- !select_varchar --
+a
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[...]
+中
+中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中�
��中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
[...]
+
+-- !select_char --
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
+
+-- !select_all_types_multi_block --
+3075 3075
+
diff --git
a/regression-test/data/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.out
b/regression-test/data/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.out
new file mode 100644
index 00000000000..dacd255426a
--- /dev/null
+++
b/regression-test/data/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.out
@@ -0,0 +1,104 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !desc_tvf_all_types_null --
+tinyint_u smallint Yes true \N NONE
+smallint_u int Yes true \N NONE
+mediumint_u int Yes true \N NONE
+int_u bigint Yes true \N NONE
+bigint_u largeint Yes true \N NONE
+decimal1_u decimal(11,0) Yes true \N NONE
+decimal2_u decimal(10,2) Yes true \N NONE
+decimal3_u decimal(19,5) Yes true \N NONE
+decimal4_u text Yes true \N NONE
+decimal5_u text Yes true \N NONE
+double_u double Yes true \N NONE
+float_u float Yes true \N NONE
+boolean tinyint Yes true \N NONE
+tinyint tinyint Yes true \N NONE
+smallint smallint Yes true \N NONE
+mediumint int Yes true \N NONE
+int int Yes true \N NONE
+bigint bigint Yes true \N NONE
+double double Yes true \N NONE
+float float Yes true \N NONE
+decimal1 decimal(10,0) Yes true \N NONE
+decimal2 decimal(9,2) Yes true \N NONE
+decimal3 decimal(18,5) Yes true \N NONE
+decimal4 decimal(38,10) Yes true \N NONE
+decimal5 text Yes true \N NONE
+year smallint Yes true \N NONE
+time1 text Yes true \N NONE
+time2 text Yes true \N NONE
+time3 text Yes true \N NONE
+date date Yes true \N NONE
+datetime datetime Yes true \N NONE
+timestamp1 datetime Yes true \N NONE
+timestamp2 datetime(3) Yes true \N NONE
+timestamp3 datetime(6) Yes true \N NONE
+char char(6) Yes true \N NONE
+varchar varchar(10) Yes true \N NONE
+text text Yes true \N NONE
+blob text Yes true \N NONE
+json text Yes true \N NONE
+set char(6) Yes true \N NONE
+bit text Yes true \N NONE
+binary text Yes true \N NONE
+varbinary text Yes true \N NONE
+enum char(6) Yes true \N NONE
+
+-- !tvf_null_all_types_null --
+\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N \N \N \N \N \N \N
\N \N \N \N
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
+-- !desc_tvf_all_types_non_null --
+tinyint_u smallint Yes true \N NONE
+smallint_u int Yes true \N NONE
+mediumint_u int Yes true \N NONE
+int_u bigint Yes true \N NONE
+bigint_u largeint Yes true \N NONE
+decimal1_u decimal(11,0) Yes true \N NONE
+decimal2_u decimal(10,2) Yes true \N NONE
+decimal3_u decimal(19,5) Yes true \N NONE
+decimal4_u text Yes true \N NONE
+decimal5_u text Yes true \N NONE
+double_u double Yes true \N NONE
+float_u float Yes true \N NONE
+boolean tinyint Yes true \N NONE
+tinyint tinyint Yes true \N NONE
+smallint smallint Yes true \N NONE
+mediumint int Yes true \N NONE
+int int Yes true \N NONE
+bigint bigint Yes true \N NONE
+double double Yes true \N NONE
+float float Yes true \N NONE
+decimal1 decimal(10,0) Yes true \N NONE
+decimal2 decimal(9,2) Yes true \N NONE
+decimal3 decimal(18,5) Yes true \N NONE
+decimal4 decimal(38,10) Yes true \N NONE
+decimal5 text Yes true \N NONE
+year smallint Yes true \N NONE
+time1 text Yes true \N NONE
+time2 text Yes true \N NONE
+time3 text Yes true \N NONE
+date date Yes true \N NONE
+datetime datetime Yes true \N NONE
+timestamp1 datetime Yes true \N NONE
+timestamp2 datetime(3) Yes true \N NONE
+timestamp3 datetime(6) Yes true \N NONE
+char char(6) Yes true \N NONE
+varchar varchar(10) Yes true \N NONE
+text text Yes true \N NONE
+blob text Yes true \N NONE
+json text Yes true \N NONE
+set char(6) Yes true \N NONE
+bit text Yes true \N NONE
+binary text Yes true \N NONE
+varbinary text Yes true \N NONE
+enum char(6) Yes true \N NONE
+
+-- !tvf_null_all_types_non_null --
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 -128 -32768 -8388608 -2147483648
-9223372036854775808 -1.7976931348623157E308 -3.40282E38 -9999999999
-9999999.99 -9999999999999.99999
-9999999999999999999999999999.9999999999
-99999999999999999999999999999999999.999999999999999999999999999999 1901
-838:59:59 -838:59:59 -838:59:59 1000-01-01
1000-01-01T00:00 1970-01-01T00:00:01 1970-01-01T00:00:01
1970-01-01T00:00:01 0x {} 0x00
0x000000000000000000000000 0x Value1
+0 0 0 0 0 0 0.00 0.00000 0E-10 0E-30
0.0 0.0 0 0 0 0 0 0 0.0 0.0
0 0.00 0.00000 0E-10 0E-30 1901 00:00:00 00:00:00
00:00:00 1000-01-01 1000-01-01T00:00 1970-01-01T00:00:01
1970-01-01T00:00:01 1970-01-01T00:00:01 0x
{} 0x00 0x000000000000000000000000 0x Value1
+255 65535 16777215 4294967295 18446744073709551615
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999
1.7976931348623157E308 3.40282E38 1 127 32767 8388607
2147483647 9223372036854775807 1.7976931348623157E308 3.40282E38
9999999999 9999999.99 9999999999999.99999
9999999999999999999999999999.9999999999
99999999999999999999999999999999999.999999999999999999999999999999 2155
838:59:59 838:59:59 [...]
+
diff --git
a/regression-test/suites/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.groovy
b/regression-test/suites/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.groovy
new file mode 100644
index 00000000000..aee5642515b
--- /dev/null
+++
b/regression-test/suites/external_table_p0/jdbc/type_test/ctas/test_mysql_all_types_ctas.groovy
@@ -0,0 +1,61 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_mysql_all_types_ctas",
"p0,external,mysql,external_docker,external_docker_mysql") {
+ String enabled = context.config.otherConfigs.get("enableJdbcTest")
+ String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+ String s3_endpoint = getS3Endpoint()
+ String bucket = getS3BucketName()
+ String driver_url =
"https://${bucket}.${s3_endpoint}/regression/jdbc_driver/mysql-connector-j-8.3.0.jar"
+ if (enabled != null && enabled.equalsIgnoreCase("true")) {
+ String mysql_port = context.config.otherConfigs.get("mysql_57_port");
+
+ sql """drop database if exists test_mysql_all_types_ctas;"""
+
+ sql """create database if not exists test_mysql_all_types_ctas;"""
+
+ sql """drop catalog if exists mysql_all_type_ctas_test """
+ sql """create catalog if not exists mysql_all_type_ctas_test
properties(
+ "type"="jdbc",
+ "user"="root",
+ "password"="123456",
+ "jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false",
+ "driver_url" = "${driver_url}",
+ "driver_class" = "com.mysql.cj.jdbc.Driver"
+ );"""
+
+ sql """use internal.test_mysql_all_types_ctas;"""
+
+ sql """create table all_types_nullable properties("replication_num" =
"1") as select * from mysql_all_type_ctas_test.doris_test.all_types_nullable;"""
+
+ qt_select_all_types_nullable """select * from
internal.test_mysql_all_types_ctas.all_types_nullable order by 1;"""
+
+ sql """create table all_types_non_nullable
properties("replication_num" = "1") as select * from
mysql_all_type_ctas_test.doris_test.all_types_non_nullable;"""
+
+ qt_select_all_types_non_nullable """select * from
internal.test_mysql_all_types_ctas.all_types_non_nullable order by 1;"""
+
+ sql """create table t_varchar properties("replication_num" = "1") as
select * from mysql_all_type_ctas_test.doris_test.t_varchar;"""
+
+ qt_select_varchar """select * from
internal.test_mysql_all_types_ctas.t_varchar order by 1;"""
+
+ sql """create table t_char properties("replication_num" = "1") as
select * from mysql_all_type_ctas_test.doris_test.t_char;"""
+
+ qt_select_char """select * from
internal.test_mysql_all_types_ctas.t_char order by 1;"""
+
+ sql """drop database if exists test_mysql_all_types_ctas;"""
+ }
+}
diff --git
a/regression-test/suites/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.groovy
b/regression-test/suites/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.groovy
new file mode 100644
index 00000000000..2bd14d6742b
--- /dev/null
+++
b/regression-test/suites/external_table_p0/jdbc/type_test/select/test_doris_all_types_select.groovy
@@ -0,0 +1,206 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_doris_all_types_select",
"p0,external,doris,external_docker,external_docker_doris") {
+ String jdbcUrl = context.config.jdbcUrl +
"&sessionVariables=return_object_data_as_binary=true"
+ String jdbcUser = context.config.jdbcUser
+ String jdbcPassword = context.config.jdbcPassword
+ String s3_endpoint = getS3Endpoint()
+ String bucket = getS3BucketName()
+ String driver_url =
"https://${bucket}.${s3_endpoint}/regression/jdbc_driver/mysql-connector-j-8.3.0.jar"
+ String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+
+ String doris_port = context.config.otherConfigs.get("doris_port");
+
+ sql """create database if not exists test_doris_all_types_select;"""
+
+ sql """use internal.test_doris_all_types_select;"""
+
+ sql """drop table if exists all_types_nullable"""
+ sql """
+ create table all_types_nullable (
+ bool_col boolean,
+ tinyint_col tinyint,
+ smallint_col smallint,
+ int_col int,
+ bigint_col bigint,
+ largeint_col largeint,
+ float_col float,
+ double_col double,
+ decimal_col decimal(38, 10),
+ date_col date,
+ datetime_col1 datetime,
+ datetime_col2 datetime(3),
+ datetime_col3 datetime(6),
+ char_col char(255),
+ varchar_col varchar(65533),
+ string_col string,
+ json_col json,
+ )
+ DUPLICATE KEY(`bool_col`)
+ DISTRIBUTED BY HASH(`bool_col`) BUCKETS 3
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+ sql """insert into all_types_nullable values (false, -128, -32768,
-2147483648, -9223372036854775808, -170141183460469231731687303715884105727,
-3.4028234e+38, -1.7976931348623157e+308,
-9999999999999999999999999999.9999999999, '0000-01-01', '0000-01-01 00:00:00',
'0000-01-01 00:00:00.000', '0000-01-01 00:00:00.000000', 'a', 'a', '-string',
'{\"a\": 0}');"""
+ sql """insert into all_types_nullable values (true, 127, 32767,
2147483647, 9223372036854775807, 170141183460469231731687303715884105727,
3.4028234e+38, 1.7976931348623157e+308,
9999999999999999999999999999.9999999999, '9999-12-31', '9999-12-31 23:59:59',
'9999-12-31 23:59:59.999', '9999-12-31 23:59:59.999999', REPEAT('a', 255),
REPEAT('a', 65533), '+string', '{\"a\": 1}');"""
+ sql """insert into all_types_nullable values (null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null,
null);"""
+
+ sql """drop table if exists all_types_non_nullable"""
+ sql """
+ create table all_types_non_nullable (
+ bool_col boolean not null,
+ tinyint_col tinyint not null,
+ smallint_col smallint not null,
+ int_col int not null,
+ bigint_col bigint not null,
+ largeint_col largeint not null,
+ float_col float not null,
+ double_col double not null,
+ decimal_col decimal(38, 10) not null,
+ date_col date not null,
+ datetime_col1 datetime not null,
+ datetime_col2 datetime(3) not null,
+ datetime_col3 datetime(6) not null,
+ char_col char(255) not null,
+ varchar_col varchar(65533) not null,
+ string_col string not null,
+ json_col json not null,
+ )
+ DUPLICATE KEY(`bool_col`)
+ DISTRIBUTED BY HASH(`bool_col`) BUCKETS 3
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ sql """insert into all_types_non_nullable values (false, -128, -32768,
-2147483648, -9223372036854775808, -170141183460469231731687303715884105727,
-3.4028234e+38, -1.7976931348623157e+308,
-9999999999999999999999999999.9999999999, '0000-01-01', '0000-01-01 00:00:00',
'0000-01-01 00:00:00.000', '0000-01-01 00:00:00.000000', 'a', 'a', '-string',
'{\"a\": 0}');"""
+ sql """insert into all_types_non_nullable values (true, 127, 32767,
2147483647, 9223372036854775807, 170141183460469231731687303715884105727,
3.4028234e+38, 1.7976931348623157e+308,
9999999999999999999999999999.9999999999, '9999-12-31', '9999-12-31 23:59:59',
'9999-12-31 23:59:59.999', '9999-12-31 23:59:59.999999', REPEAT('a', 255),
REPEAT('a', 65533), '+string', '{\"a\": 1}');"""
+
+ sql """drop table if exists t_hll_bitmap"""
+
+ sql """
+ create table t_hll_bitmap (
+ k int,
+ bitmap_c bitmap BITMAP_UNION,
+ hll_c hll HLL_UNION
+ )
+ aggregate key (k)
+ distributed by hash(k) buckets 1
+ PROPERTIES (
+ "replication_num" = "1"
+ );
+ """
+
+ sql """insert into t_hll_bitmap values (1, to_bitmap(1), hll_hash(1));"""
+ sql """insert into t_hll_bitmap values (2, to_bitmap(2), hll_hash(2));"""
+ sql """insert into t_hll_bitmap values (3, to_bitmap(3), hll_hash(3));"""
+ sql """insert into t_hll_bitmap values (4, to_bitmap(4), hll_hash(4));"""
+
+ sql """drop table if exists arr_types_test """
+ sql """
+ create table arr_types_test (
+ int_col int,
+ arr_bool_col array<boolean>,
+ arr_tinyint_col array<tinyint>,
+ arr_smallint_col array<smallint>,
+ arr_int_col array<int>,
+ arr_bigint_col array<bigint>,
+ arr_largeint_col array<largeint>,
+ arr_float_col array<float>,
+ arr_double_col array<double>,
+ arr_decimal1_col array<decimal(10, 5)>,
+ arr_decimal2_col array<decimal(30, 10)>,
+ arr_date_col array<date>,
+ arr_datetime_col array<datetime(3)>,
+ arr_char_col array<char(10)>,
+ arr_varchar_col array<varchar(10)>,
+ arr_string_col array<string>
+ )
+ DUPLICATE KEY(`int_col`)
+ DISTRIBUTED BY HASH(`int_col`) BUCKETS 3
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ sql """insert into arr_types_test values (1, array(true), array(1),
array(1), array(1), array(1), array(1), array(1.0), array(1.0), array(1.0),
array(1.0), array('2021-01-01'), array('2021-01-01 00:00:00.000'), array('a'),
array('a'), array('a'));"""
+ sql """insert into arr_types_test values (2, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null);"""
+
+ sql """drop table if exists arr_nesting_types_test """
+ sql """
+ create table arr_nesting_types_test (
+ int_col int,
+ arr_arr_bool_col array<array<boolean>>,
+ arr_arr_tinyint_col array<array<tinyint>>,
+ arr_arr_smallint_col array<array<smallint>>,
+ arr_arr_int_col array<array<int>>,
+ arr_arr_bigint_col array<array<bigint>>,
+ arr_arr_largeint_col array<array<largeint>>,
+ arr_arr_float_col array<array<float>>,
+ arr_arr_double_col array<array<double>>,
+ arr_arr_decimal1_col array<array<decimal(10, 5)>>,
+ arr_arr_decimal2_col array<array<decimal(30, 10)>>,
+ arr_arr_date_col array<array<date>>,
+ arr_arr_datetime_col array<array<datetime(3)>>,
+ arr_arr_char_col array<array<char(10)>>,
+ arr_arr_varchar_col array<array<varchar(10)>>,
+ arr_arr_string_col array<array<string>>
+ )
+ DUPLICATE KEY(`int_col`)
+ DISTRIBUTED BY HASH(`int_col`) BUCKETS 3
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ sql """insert into arr_nesting_types_test values (1, array(array(true)),
array(array(1)), array(array(1)), array(array(1)), array(array(1)),
array(array(1)), array(array(1.0)), array(array(1.0)), array(array(1.0)),
array(array(1.0)), array(array('2021-01-01')), array(array('2021-01-01
00:00:00.000')), array(array('a')), array(array('a')), array(array('a')));"""
+ sql """insert into arr_nesting_types_test values (2,
array(array(true),array(true)), array(array(1),array(1)),
array(array(1),array(1)), array(array(1),array(1)), array(array(1),array(1)),
array(array(1),array(1)), array(array(1.0),array(1.0)),
array(array(1.0),array(1.0)), array(array(1.0),array(1.0)),
array(array(1.0),array(1.0)), array(array('2021-01-01'),array('2021-01-01')),
array(array('2021-01-01 00:00:00.000'),array('2021-01-01 00:00:00.000')),
array(array('a'),array('a')), a [...]
+ sql """insert into arr_nesting_types_test values (3, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null);"""
+
+ sql """drop catalog if exists doris_all_type_test """
+
+ sql """ CREATE CATALOG doris_all_type_test PROPERTIES (
+ "user" = "${jdbcUser}",
+ "type" = "jdbc",
+ "password" = "${jdbcPassword}",
+ "jdbc_url" = "${jdbcUrl}",
+ "driver_url" = "${driver_url}",
+ "driver_class" = "com.mysql.cj.jdbc.Driver"
+ )
+ """
+
+ qt_desc_all_types_nullable """desc
doris_all_type_test.test_doris_all_types_select.all_types_nullable;"""
+ qt_select_all_types_nullable """select * except(float_col) from
doris_all_type_test.test_doris_all_types_select.all_types_nullable order by
1;"""
+
+ qt_desc_all_types_non_nullable """desc
doris_all_type_test.test_doris_all_types_select.all_types_non_nullable;"""
+ qt_select_all_types_non_nullable """select * except(float_col) from
doris_all_type_test.test_doris_all_types_select.all_types_non_nullable order by
1;"""
+
+ qt_desc_bitmap_hll """desc
doris_all_type_test.test_doris_all_types_select.t_hll_bitmap;"""
+ qt_select_bitmap_hll """select k, bitmap_union_count(bitmap_c),
hll_union_agg(hll_c) from
doris_all_type_test.test_doris_all_types_select.t_hll_bitmap group by k order
by 1;"""
+
+ qt_desc_arr_types_test """desc
doris_all_type_test.test_doris_all_types_select.arr_types_test;"""
+ qt_select_arr_types_test """select * from
doris_all_type_test.test_doris_all_types_select.arr_types_test order by 1;"""
+
+ qt_desc_arr_nesting_types_test """desc
doris_all_type_test.test_doris_all_types_select.arr_nesting_types_test;"""
+ qt_select_arr_nesting_types_test """select * from
doris_all_type_test.test_doris_all_types_select.arr_nesting_types_test order by
1;"""
+
+ sql """drop database if exists test_doris_all_types_select;"""
+ sql """drop catalog if exists doris_all_type_test """
+
+}
diff --git
a/regression-test/suites/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.groovy
b/regression-test/suites/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.groovy
new file mode 100644
index 00000000000..e91e46e02f7
--- /dev/null
+++
b/regression-test/suites/external_table_p0/jdbc/type_test/select/test_mysql_all_types_select.groovy
@@ -0,0 +1,52 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_mysql_all_types_select",
"p0,external,mysql,external_docker,external_docker_mysql") {
+ String enabled = context.config.otherConfigs.get("enableJdbcTest")
+ String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+ String s3_endpoint = getS3Endpoint()
+ String bucket = getS3BucketName()
+ String driver_url =
"https://${bucket}.${s3_endpoint}/regression/jdbc_driver/mysql-connector-j-8.3.0.jar"
+ if (enabled != null && enabled.equalsIgnoreCase("true")) {
+ String mysql_port = context.config.otherConfigs.get("mysql_57_port");
+
+ sql """drop catalog if exists mysql_all_type_test """
+ sql """create catalog if not exists mysql_all_type_test properties(
+ "type"="jdbc",
+ "user"="root",
+ "password"="123456",
+ "jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false",
+ "driver_url" = "${driver_url}",
+ "driver_class" = "com.mysql.cj.jdbc.Driver"
+ );"""
+
+ sql """use mysql_all_type_test.doris_test"""
+
+ qt_desc_all_types_null """desc all_types_nullable;"""
+ qt_select_all_types_null """select * from all_types_nullable order by
1;"""
+
+ qt_desc_all_types_non_null """desc all_types_non_nullable;"""
+ qt_select_all_types_non_null """select * from all_types_non_nullable
order by 1;"""
+
+ qt_select_varchar """select * from t_varchar order by 1;"""
+ qt_select_char """select * from t_char order by 1;"""
+
+ qt_select_all_types_multi_block """select
count(`int`),count(`varchar`) from all_types_multi_block;"""
+
+ sql """drop catalog if exists mysql_all_type_test """
+ }
+}
diff --git
a/regression-test/suites/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.groovy
b/regression-test/suites/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.groovy
new file mode 100644
index 00000000000..3e9a9b04744
--- /dev/null
+++
b/regression-test/suites/external_table_p0/jdbc/type_test/tvf/test_mysql_all_types_tvf.groovy
@@ -0,0 +1,48 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_mysql_all_types_tvf",
"p0,external,mysql,external_docker,external_docker_mysql") {
+ String enabled = context.config.otherConfigs.get("enableJdbcTest")
+ String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+ String s3_endpoint = getS3Endpoint()
+ String bucket = getS3BucketName()
+ String driver_url =
"https://${bucket}.${s3_endpoint}/regression/jdbc_driver/mysql-connector-j-8.3.0.jar"
+ if (enabled != null && enabled.equalsIgnoreCase("true")) {
+ String mysql_port = context.config.otherConfigs.get("mysql_57_port");
+
+ sql """drop catalog if exists mysql_all_type_tvf_test """
+ sql """create catalog if not exists mysql_all_type_tvf_test properties(
+ "type"="jdbc",
+ "user"="root",
+ "password"="123456",
+ "jdbc_url" =
"jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false",
+ "driver_url" = "${driver_url}",
+ "driver_class" = "com.mysql.cj.jdbc.Driver"
+ );"""
+
+ qt_desc_tvf_all_types_null """desc function query('catalog' =
'mysql_all_type_tvf_test', 'query' = 'select * from all_types_nullable')"""
+
+ qt_tvf_null_all_types_null """select * from query('catalog' =
'mysql_all_type_tvf_test', 'query' = 'select * from all_types_nullable') order
by 1;"""
+
+ qt_desc_tvf_all_types_non_null """desc function query('catalog' =
'mysql_all_type_tvf_test', 'query' = 'select * from all_types_non_nullable')"""
+
+ qt_tvf_null_all_types_non_null """select * from query('catalog' =
'mysql_all_type_tvf_test', 'query' = 'select * from all_types_non_nullable')
order by 1;"""
+
+
+ sql """drop catalog if exists mysql_all_type_tvf_test """
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]