doris 使用 catalog 连接 mysql 查询时,有部份表查不出来

Viewed 25

doris 版本:2.1.5
部署:单节点
OS:linux 7
mysql版本:mysql 5.7.31

问题描述:我们在 drois 上创建了一个 catalog 连接 mysql,在mysql中新建了一张表,在 catalog 中查询时,发现找不到该表,错语信息如下:
1051 - errCode = 2, detailMessage = Unknown table 'emphasis_goods_sale_period_station_d_tmp'

还有一个发现:我在 mysql中又另新建了一张表,在 doris 中用catalog查询,仍然查不出来,但以前的表可以正常查询。
重启fe 和 be 后,问题仍然存在。

2 Answers
  1. refresh catalog 执行了不
  2. switch catalog; use database; show tables; 能看到表不

确定下这两个的

refresh catalog 后可以正常的访问。
我查了一下官网,在 2.1.5及之前的版本,catalog 解决新建表的查询问题有 2 种方法:
1、手动刷新
2、自动刷新:需要在catalog 中 添加参数 metadata_refresh_interval_sec=3600,表示每隔 60 秒自动刷新一次。