odc之前配置了doris数据源,用的是testdb用户,可以正常查询。
后来连接doris 端口9030 修改了doris的testdb用户的密码,并且是可以连接doris的和拥有相应的权限,如下:
在doris上测试在doris是可以连接成功的。如下:
然后更新了odc的doris的数据源配置,测试连接是成功的(也是用的testdb用户),可以看到doris的表信息,如下:
部分表是可以查询,部分查询报错:
请求失败
请求 ID:L78EADDIGWRMAWVWB16T9
预期外异常,错误详情:Query table information failed, table name=xxx, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP
1 个赞
菁甜
2024 年11 月 19 日 10:42
#3
麻烦提供下报错的表的ddl。
请问 odc 和连接的 doris 数据库版本号分别是?
1 个赞
版本号:4.2.4-1715688910000
doris版本:2.12
CREATE TABLE
`log` (
`atime` DATETIME NULL,
`business` VARCHAR(200) NULL,
`idc_name` VARCHAR(100) NULL,
`node_id` TINYINT NULL,
`ip` VARCHAR(100) NULL,
`logType` VARCHAR(100) NULL,
`engine_type` VARCHAR(100) NULL,
`time` BIGINT NULL,
`logInfo` TEXT NULL
) ENGINE = OLAP DUPLICATE KEY(
....
1 个赞
CREATE TABLE IF NOT EXISTS `item_log`
(
`stime` datetime NULL,
`business` varchar(200) NULL,
`idc_name` varchar(100) NULL,
`node_id` tinyint NULL,
`ip` varchar(100) NULL,
`logType` varchar(100) NULL,
`engine_type` varchar(100) NULL,
`time` bigint(20) NULL,
`logInfo` text NULL
)
DUPLICATE KEY(`stime`,`business`,`idc_name`,`node_id`,`ip`,`logType`,`engine_type`)
PARTITION BY RANGE(`stime`)()
DISTRIBUTED BY HASH(`business`)
PROPERTIES
(
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.start" = "-7",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "item_log_p",
"dynamic_partition.buckets" = "16"
);
handler=com.oceanbase.odc.server.web.controller.v2.DBTableController#getTable[3 args], exceptionType=UnexpectedException, message=Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP, rootReason= at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at com.oceanbase.odc.server.web.controller.v2.DBTableController$$FastClassBySpringCGLIB$$a1ca1193.invoke() at com.oceanbase.odc.server.web.controller.v2.DBTableController.getTable(DBTableController.java:74) at com.oceanbase.odc.service.db.DBTableService.getTable(DBTableService.java:101) com.oceanbase.odc.core.shared.exception.UnexpectedException: 预期外异常,错误详情:Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP, perfLevel=P2, response=ErrorResponse(error=Error(code=Unexpected, message=预期外异常,错误详情:Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP, details=[Error.Detail(code=Unexpected, target=null, message=Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP), Error.Detail(code=UnexpectedException, target=null, message=Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP)]), code=Unexpected, message=预期外异常,错误详情:Query table information failed, table name=table_hash, error massage=No enum constant com.oceanbase.tools.dbbrowser.model.DBTableColumn.KeyType.DUP)
这是odc的日志
菁甜
2024 年11 月 19 日 14:38
#8
麻烦对有报错的表执行下这个sql,看下查询结果:
SELECT
TABLE_NAME,
TABLE_SCHEMA,
ORDINAL_POSITION,
COLUMN_NAME,
DATA_TYPE,
COLUMN_TYPE,
COLUMN_KEY
FROM
information_schema.columns
WHERE
TABLE_SCHEMA = {your_schema_name} AND TABLE_NAME = {your_table_name}
ORDER BY
ORDINAL_POSITION ASC;
菁甜:
SELECT
TABLE_NAME,
TABLE_SCHEMA,
ORDINAL_POSITION,
COLUMN_NAME,
DATA_TYPE,
COLUMN_TYPE,
COLUMN_KEY
FROM
information_schema.columns
WHERE
TABLE_SCHEMA = {your_schema_name} AND TABLE_NAME = {your_table_name}
ORDER BY
ORDINAL_POSITION ASC;
+------------+--------------+------------------+-------------+-----------+------------------+------------+
| TABLE_NAME | TABLE_SCHEMA | ORDINAL_POSITION | COLUMN_NAME | DATA_TYPE | COLUMN_TYPE | COLUMN_KEY |
+------------+--------------+------------------+-------------+-----------+------------------+------------+
| table_hash | testdb | 1 | k1 | tinyint | tinyint(4) | DUP |
| table_hash | testdb | 2 | k2 | decimal | decimalv3(10, 2) | DUP |
| table_hash | testdb | 3 | k3 | varchar | varchar(10) | DUP |
| table_hash | testdb | 4 | k4 | int | int(11) | |
+------------+--------------+------------------+-------------+-----------+------------------+------------+
4 rows in set (0.02 sec)
doris自带的客户端和其他的客户端 都是正常可以查询的,odc web ui 就不行
菁甜
2024 年11 月 19 日 16:28
#11
odc 报错的原因是 目前odc对于doris 数据源还没有支持 COLUMN_KEY 为 DUP 的类型。已建issue,会在后续版本中修复:
opened 08:27AM - 19 Nov 24 UTC
type-bug
priority-medium
### ODC version
all
### OB version
doris
### What happened?
Failed to get t… able when the COLUMN_KEY field in information_schema.columns is DUP:
<img width="365" alt="image" src="https://github.com/user-attachments/assets/2cc7bcd2-6365-4eb9-91ad-c5b0afc5b542">
### What did you expect to happen?
Successfully viewed table object
### How can we reproduce it (as minimally and precisely as possible)?
use doris datasource,create a table with ddl:
```
CREATE TABLE IF NOT EXISTS `item_log`
(
`stime` datetime NULL,
`business` varchar(200) NULL,
`idc_name` varchar(100) NULL,
`node_id` tinyint NULL,
`ip` varchar(100) NULL,
`logType` varchar(100) NULL,
`engine_type` varchar(100) NULL,
`time` bigint(20) NULL,
`logInfo` text NULL
)
DUPLICATE KEY(`stime`,`business`,`idc_name`,`node_id`,`ip`,`logType`,`engine_type`)
PARTITION BY RANGE(`stime`)()
DISTRIBUTED BY HASH(`business`)
PROPERTIES
(
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.start" = "-7",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "item_log_p",
"dynamic_partition.buckets" = "16"
);
```
<img width="711" alt="image" src="https://github.com/user-attachments/assets/f8c4469c-b822-4daa-88de-dfabd1957047">
Click to view table object.
### Anything else we need to know?
_No response_
那就很奇怪了,为什么在修改testdb用户名之前 就不会报错呢? 之前用了几个月,后来因为重置testdb的密码重连后就报错了。
淇铭
2024 年11 月 20 日 09:33
#13
bull020:
COLUMN_KEY
之前创建的表COLUMN_KEY是不是没有DUP类型呀
一样的,啥都没有动,就是重置了连接用户的密码而已。然后就报错了,doris里面的东西都没有动。
菁甜
2024 年11 月 20 日 10:27
#15
和重置了密码没有关系的,您可以随便找一张通过以下sql 查询出来的 COLUMN_KEY 为 DUP 的表,在odc上查看该表对象详情应该都会报这个错
SELECT COLUMN_KEY FROM information_schema.columns
WHERE TABLE_SCHEMA = {your_schema_name} AND TABLE_NAME = {your_table_name}
ORDER BY ORDINAL_POSITION ASC;
其实之前用小半年都没有事情,所有的表都可以正常检索分析。然后突然就不可以了,难道是重置连接 触发了什么bug?要不然说不通啊,如果之前表的设计上有什么问题或者不兼容的,那应该一直都访问报错才对!
菁甜
2024 年11 月 20 日 15:04
#18
这个报错信息和重置密码是没有关系的,日志里写明了是不支持这个UDP字段。