branch-2.1: [fix](jdbc catalog) Get statistics using remote name #46040 (#46116)

Cherry-picked from https://github.com/apache/doris/pull/46040
This commit is contained in:
zy-kkk
2024-12-27 20:59:18 +08:00
committed by GitHub
parent 8ac54b63c5
commit 75e9aa3fb4

View File

@ -182,8 +182,8 @@ public class JdbcExternalTable extends ExternalTable {
public long fetchRowCount() {
Map<String, String> params = new HashMap<>();
params.put("ctlName", catalog.getName());
params.put("dbName", dbName);
params.put("tblName", name);
params.put("dbName", this.db.getRemoteName());
params.put("tblName", this.remoteName);
switch (((JdbcExternalCatalog) catalog).getDatabaseTypeName()) {
case JdbcResource.MYSQL:
try (AutoCloseConnectContext r = StatisticsUtil.buildConnectContext(false)) {