You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/04/21 06:22:37 UTC

[GitHub] [doris] morningman commented on a diff in pull request #18834: [feature](multi-catalog) Rename multi-catalog config 'specified_database_list' to 'include_database_list', and introduce new multi-catalog config 'exclude_database_list'

morningman commented on code in PR #18834:
URL: https://github.com/apache/doris/pull/18834#discussion_r1173346789


##########
docs/en/docs/lakehouse/multi-catalog/hive.md:
##########
@@ -56,10 +56,13 @@ CREATE CATALOG hive PROPERTIES (
 
  In addition to `type` and  `hive.metastore.uris` , which are required, you can specify other parameters regarding the connection.
 
-> `specified_database_list`:
-> 
-> only synchronize the specified databases, split with ','. Default values is '' will synchronize all databases. db name is case sensitive.
-> 
+> `include_database_list`:

Review Comment:
   This is a common property, you can put it in this doc: https://doris.apache.org/zh-CN/docs/dev/lakehouse/multi-catalog/
   So that you don't need to write it for every catalog type
   



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java:
##########
@@ -130,10 +130,15 @@ protected void init() {
         initCatalogLog.setCatalogId(id);
         initCatalogLog.setType(InitCatalogLog.Type.HMS);
         List<String> allDatabases = client.getAllDatabases();
-        Map<String, Boolean> specifiedDatabaseMap = getSpecifiedDatabaseMap();
+        Map<String, Boolean> includeDatabaseMap = getIncludeDatabaseMap();
+        Map<String, Boolean> excludeDatabaseMap = getExcludeDatabaseMap();
         // Update the db name to id map.
         for (String dbName : allDatabases) {
-            if (!specifiedDatabaseMap.isEmpty() && specifiedDatabaseMap.get(dbName) == null) {
+            // Exclude database map take effect with higher priority over include database map
+            if (!excludeDatabaseMap.isEmpty() && excludeDatabaseMap.get(dbName) != null) {

Review Comment:
   same for others



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java:
##########
@@ -130,10 +130,15 @@ protected void init() {
         initCatalogLog.setCatalogId(id);
         initCatalogLog.setType(InitCatalogLog.Type.HMS);
         List<String> allDatabases = client.getAllDatabases();
-        Map<String, Boolean> specifiedDatabaseMap = getSpecifiedDatabaseMap();
+        Map<String, Boolean> includeDatabaseMap = getIncludeDatabaseMap();
+        Map<String, Boolean> excludeDatabaseMap = getExcludeDatabaseMap();
         // Update the db name to id map.
         for (String dbName : allDatabases) {
-            if (!specifiedDatabaseMap.isEmpty() && specifiedDatabaseMap.get(dbName) == null) {
+            // Exclude database map take effect with higher priority over include database map
+            if (!excludeDatabaseMap.isEmpty() && excludeDatabaseMap.get(dbName) != null) {

Review Comment:
   ```suggestion
               if (!excludeDatabaseMap.isEmpty() && excludeDatabaseMap.containsKey(dbName)) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org