【已解决】关于Doris 2.1.0 访问Oracle外部目录表时,数据库名称大小写问题

Viewed 66

发现一个问题:doris 从2.0.4 版本升级到 2.1.0 版本,发现有一个跟原来不一致的地方,原来版本使用oracle jdbc外部表访问时,oracle外部表的数据库名称需要小写,升到2.1.0后,oracle外部表的数据库名称需要大写。在 doris 2.1.0 运行具体示例如下:


mysql> show create catalog jdbc_oracle_test;
+------------------+--------------------------
| Catalog          | CreateCatalog              
+------------------+--------------------------
| jdbc_oracle_test | 
CREATE CATALOG `jdbc_oracle_test` PROPERTIES (
"user" = "test",
"type" = "jdbc",
"password" = "*XXX",
"lower_case_table_names" = "true",
"jdbc_url" = "jdbc:oracle:thin:@192.168.1.100:1521/orcl",
"driver_url" = "ojdbc6-11.2.0.4.jar",
"driver_class" = "oracle.jdbc.driver.OracleDriver",
"checksum" = "76852c42c44401f44d26319a74e55f5b"
); |
+------------------+---------------------------
1 row in set (0.01 sec)


mysql> select count(1) from jdbc_oracle_test.test.all_test;
ERROR 1049 (42000): errCode = 2, detailMessage = Unknown database 'test'


mysql> select count(1) from jdbc_oracle_test.TEST.all_test;
+----------+
| count(1) |
+----------+
|   848649 |
+----------+
1 row in set (5.07 sec)


3 Answers

重新使用"lower_case_meta_names" = "true" 创建 catalog 可以,理论上升级会自动把lower_case_table_names改成lower_case_meta_names,可以在日志里搜一下有没有Modify lower_case_table_names to lower_case_meta_names的记录,以及有没有其他的一些异常

按照新的语法形式重新创建一下外部目录就好用了


DROP CATALOG jdbc_oracle_test;

CREATE CATALOG jdbc_oracle_test PROPERTIES (
"user" = "test",
"type" = "jdbc",
"password" = "*XXX",
"lower_case_meta_names" = "true",
"jdbc_url" = "jdbc:oracle:thin:@192.168.1.100:1521/orcl",
"driver_url" = "ojdbc6-11.2.0.4.jar",
"driver_class" = "oracle.jdbc.driver.OracleDriver"
);