[improvement](jdbc catalog)Adjustment to JDBC External Table Configuration Based on Internal Table Settings (#25059)

This pull request addresses the behavior of the `lower_case_table_names` parameter for jdbc catalog's based on the configuration of the internal table's corresponding parameter.

Changes:
- For internal tables, if `lower_case_table_names` is set to 1 or 2, thejdbc catalog's parameter is forcefully set to `true`.
- For internal tables, if `lower_case_table_names` is set to 0, the jdbc catalog's parameter can be either `true` or `false` with a default value of `false`.

These adjustments ensure consistency and predictability when working with both internal and external table configurations in Doris.
This commit is contained in:
zy-kkk
2023-10-07 06:25:52 -05:00
committed by GitHub
parent 9d0f4c0094
commit 5130a6c006
3 changed files with 13 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package org.apache.doris.datasource.jdbc;
import org.apache.doris.catalog.JdbcResource;
import org.apache.doris.catalog.external.JdbcExternalDatabase;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.datasource.CatalogProperty;
import org.apache.doris.datasource.ExternalCatalog;
@ -125,6 +126,12 @@ public class JdbcExternalCatalog extends ExternalCatalog {
}
public String getLowerCaseTableNames() {
// Forced to true if Config.lower_case_table_names has a value of 1 or 2
if (Config.lower_case_table_names == 1 || Config.lower_case_table_names == 2) {
return "true";
}
// Otherwise, it defaults to false
return catalogProperty.getOrDefault(JdbcResource.LOWER_CASE_TABLE_NAMES, "false");
}