Doris mysqlCatalog 读取数据与MYSQL不一致 doris2.1.7

Viewed 59

mysql的表:

CREATE TABLE test.test_aaaaa (
id int(11) NOT NULL AUTO_INCREMENT,
cur_time datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(255) DEFAULT NULL COMMENT '姓名',
age int(11) DEFAULT NULL COMMENT '年龄',
age1111 varchar(25) DEFAULT NULL COMMENT 'qqqq',
age12 int(11) DEFAULT NULL COMMENT '年龄',
age2 int(4) DEFAULT '111',
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4;

创建catalog

CREATE CATALOG bigdata_mysql PROPERTIES (
"type"="jdbc",
"user"="xxx",
"password"="xxx",
"jdbc_url" = "jdbc:mysql://xxx:3306?useSSL=false",
"driver_url" = "file:///home/data/opt/module/udf/mysql-connector-j-8.3.0.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver"
);

插入数据

INSERT INTO test.test_aaaaa (id, cur_time, name, age, age1111, age12, age2) VALUES (1, '2025-02-13 11:53:45', NULL, NULL, '', 1, 2);

使用doris查询

select *
from bigdata_mysql.test.test_aaaaa;

结果和问题

doris将数值类型的null转化为0了
image.png
使用其他客户端也是一样
image.png

2 Answers

已经解决,好像重启一下就可以了,是自己突然变好的

用 mysql-client 命令行查询试试,排除下是不是 DataGrip 的问题