You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/06 02:25:22 UTC

[GitHub] [doris] AshinGau opened a new pull request, #14842: [refactor](resource) unified resource user interface

AshinGau opened a new pull request, #14842:
URL: https://github.com/apache/doris/pull/14842

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [x] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [x] No
       - [ ] No Need
   3. Has document been added or modified:
       - [x] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [x] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [x] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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


[GitHub] [doris] morningman commented on a diff in pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #14842:
URL: https://github.com/apache/doris/pull/14842#discussion_r1042188903


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/S3Resource.java:
##########
@@ -41,68 +40,92 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Set;
 
 /**
- * S3 resource for olap table
+ * S3 resource
  *
  * Syntax:
  * CREATE RESOURCE "remote_s3"
  * PROPERTIES
  * (
  *    "type" = "s3",
- *    "s3_endpoint" = "bj",
- *    "s3_region" = "bj",
- *    "s3_root_path" = "/path/to/root",
- *    "s3_access_key" = "bbb",
- *    "s3_secret_key" = "aaaa",
- *    "s3_max_connections" = "50",
- *    "s3_request_timeout_ms" = "3000",
- *    "s3_connection_timeout_ms" = "1000"
+ *    "AWS_ENDPOINT" = "bj",
+ *    "AWS_REGION" = "bj",
+ *    "AWS_ROOT_PATH" = "/path/to/root",
+ *    "AWS_ACCESS_KEY" = "bbb",
+ *    "AWS_SECRET_KEY" = "aaaa",
+ *    "AWS_MAX_CONNECTION" = "50",
+ *    "AWS_REQUEST_TIMEOUT_MS" = "3000",
+ *    "AWS_CONNECTION_TIMEOUT_MS" = "1000"
  * );
  */
 public class S3Resource extends Resource {
+    public enum ReferenceType {
+        TVF, // table valued function
+        LOAD,
+        EXPORT,
+        REPOSITORY,
+        OUTFILE,
+        TABLE,
+        POLICY
+    }
+
     private static final Logger LOG = LogManager.getLogger(S3Resource.class);
+    public static final String S3_PROPERTIES_PREFIX = "AWS";
+    public static final String S3_FS_PREFIX = "fs.s3";
     // required
-    public static final String S3_ENDPOINT = "s3_endpoint";
-    public static final String S3_REGION = "s3_region";
-    public static final String S3_ROOT_PATH = "s3_root_path";
-    public static final String S3_ACCESS_KEY = "s3_access_key";
-    public static final String S3_SECRET_KEY = "s3_secret_key";
-    public static final String S3_BUCKET = "s3_bucket";
+    public static final String S3_ENDPOINT = "AWS_ENDPOINT";
+    public static final String S3_REGION = "AWS_REGION";
+    public static final String S3_ACCESS_KEY = "AWS_ACCESS_KEY";
+    public static final String S3_SECRET_KEY = "AWS_SECRET_KEY";
+    public static final List<String> REQUIRED_FIELDS =
+            Arrays.asList(S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY, S3_SECRET_KEY);
+    // required by storage policy
+    public static final String S3_ROOT_PATH = "AWS_ROOT_PATH";
+    public static final String S3_BUCKET = "AWS_BUCKET";
 
     // optional
-    public static final String S3_MAX_CONNECTIONS = "s3_max_connections";
-    public static final String S3_REQUEST_TIMEOUT_MS = "s3_request_timeout_ms";
-    public static final String S3_CONNECTION_TIMEOUT_MS = "s3_connection_timeout_ms";
+    public static final String USE_PATH_STYLE = "use_path_style";
+    public static final String S3_MAX_CONNECTIONS = "AWS_MAX_CONNECTIONS";
+    public static final String S3_REQUEST_TIMEOUT_MS = "AWS_REQUEST_TIMEOUT_MS";
+    public static final String S3_CONNECTION_TIMEOUT_MS = "AWS_CONNECTION_TIMEOUT_MS";
     public static final String DEFAULT_S3_MAX_CONNECTIONS = "50";
     public static final String DEFAULT_S3_REQUEST_TIMEOUT_MS = "3000";
     public static final String DEFAULT_S3_CONNECTION_TIMEOUT_MS = "1000";
 
     @SerializedName(value = "properties")
     private Map<String, String> properties;
 
-    @SerializedName(value = "usedByPolicySet")
-    private Set<String> usedByPolicySet;
+    @SerializedName(value = "referenceSet")
+    private Map<String, ReferenceType> references;

Review Comment:
   I doubt if it is forward-compatible



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HMSResource.java:
##########
@@ -0,0 +1,84 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.BaseProcResult;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HMS resource
+ * <p>
+ * Syntax:
+ * CREATE RESOURCE "hive"
+ * PROPERTIES
+ * (
+ * "type" = "hms",
+ * "hive.metastore.uris" = "thrift://172.21.0.44:7004"
+ * );
+ */
+public class HMSResource extends Resource {
+    // required
+    public static final String HIVE_METASTORE_URIS = "hive.metastore.uris";

Review Comment:
   Maybe we need to add some `getHiveConfiguration` or `getHdfsConfiguration` for HMSResource or HdfsResource. Because some properties are read from `hdfs-site.xml` or `hive-site.xml` in `conf/` dir.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Resource.java:
##########
@@ -98,6 +100,12 @@ private static Resource getResourceInstance(ResourceType type, String name) thro
             case JDBC:
                 resource = new JdbcResource(name);
                 break;
+            case HDFS:
+                resource = new HdfsResource(name);

Review Comment:
   Add new resource class to GsonUtils.java



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsResource.java:
##########
@@ -0,0 +1,123 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.BaseProcResult;
+import org.apache.doris.thrift.THdfsConf;
+import org.apache.doris.thrift.THdfsParams;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HDFS resource
+ * <p>
+ * Syntax:
+ * CREATE RESOURCE "remote_hdfs"
+ * PROPERTIES
+ * (
+ * "type" = "hdfs",
+ * "fs.defaultFS" = "hdfs://10.220.147.151:8020",
+ * "hadoop.username" = "root"
+ * );
+ */
+public class HdfsResource extends Resource {
+    public static final String HADOOP_FS_PREFIX = "dfs.";
+    public static String HADOOP_FS_NAME = "fs.defaultFS";
+    // simple or kerberos
+    public static String HADOOP_USER_NAME = "hadoop.username";
+    public static String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
+    public static String HADOOP_KERBEROS_PRINCIPAL = "hadoop.kerberos.principal";
+    public static String HADOOP_KERBEROS_KEYTAB = "hadoop.kerberos.keytab";
+    public static String HADOOP_SHORT_CIRCUIT = "dfs.client.read.shortcircuit";
+    public static String HADOOP_SOCKET_PATH = "dfs.domain.socket.path";
+    public static List<String> REQUIRED_FIELDS = Collections.singletonList(HADOOP_FS_NAME);
+
+    @SerializedName(value = "properties")
+    private Map<String, String> properties;
+
+    public HdfsResource(String name) {
+        super(name, Resource.ResourceType.HDFS);
+        properties = Maps.newHashMap();
+    }
+
+    @Override
+    public void modifyProperties(Map<String, String> properties) throws DdlException {

Review Comment:
   Most of `override` methods can be moved to the parent class `Resource`, since they all have same logic.



-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
AshinGau commented on code in PR #14842:
URL: https://github.com/apache/doris/pull/14842#discussion_r1042835359


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/S3Resource.java:
##########
@@ -41,68 +40,92 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.Set;
 
 /**
- * S3 resource for olap table
+ * S3 resource
  *
  * Syntax:
  * CREATE RESOURCE "remote_s3"
  * PROPERTIES
  * (
  *    "type" = "s3",
- *    "s3_endpoint" = "bj",
- *    "s3_region" = "bj",
- *    "s3_root_path" = "/path/to/root",
- *    "s3_access_key" = "bbb",
- *    "s3_secret_key" = "aaaa",
- *    "s3_max_connections" = "50",
- *    "s3_request_timeout_ms" = "3000",
- *    "s3_connection_timeout_ms" = "1000"
+ *    "AWS_ENDPOINT" = "bj",
+ *    "AWS_REGION" = "bj",
+ *    "AWS_ROOT_PATH" = "/path/to/root",
+ *    "AWS_ACCESS_KEY" = "bbb",
+ *    "AWS_SECRET_KEY" = "aaaa",
+ *    "AWS_MAX_CONNECTION" = "50",
+ *    "AWS_REQUEST_TIMEOUT_MS" = "3000",
+ *    "AWS_CONNECTION_TIMEOUT_MS" = "1000"
  * );
  */
 public class S3Resource extends Resource {
+    public enum ReferenceType {
+        TVF, // table valued function
+        LOAD,
+        EXPORT,
+        REPOSITORY,
+        OUTFILE,
+        TABLE,
+        POLICY
+    }
+
     private static final Logger LOG = LogManager.getLogger(S3Resource.class);
+    public static final String S3_PROPERTIES_PREFIX = "AWS";
+    public static final String S3_FS_PREFIX = "fs.s3";
     // required
-    public static final String S3_ENDPOINT = "s3_endpoint";
-    public static final String S3_REGION = "s3_region";
-    public static final String S3_ROOT_PATH = "s3_root_path";
-    public static final String S3_ACCESS_KEY = "s3_access_key";
-    public static final String S3_SECRET_KEY = "s3_secret_key";
-    public static final String S3_BUCKET = "s3_bucket";
+    public static final String S3_ENDPOINT = "AWS_ENDPOINT";
+    public static final String S3_REGION = "AWS_REGION";
+    public static final String S3_ACCESS_KEY = "AWS_ACCESS_KEY";
+    public static final String S3_SECRET_KEY = "AWS_SECRET_KEY";
+    public static final List<String> REQUIRED_FIELDS =
+            Arrays.asList(S3_ENDPOINT, S3_REGION, S3_ACCESS_KEY, S3_SECRET_KEY);
+    // required by storage policy
+    public static final String S3_ROOT_PATH = "AWS_ROOT_PATH";
+    public static final String S3_BUCKET = "AWS_BUCKET";
 
     // optional
-    public static final String S3_MAX_CONNECTIONS = "s3_max_connections";
-    public static final String S3_REQUEST_TIMEOUT_MS = "s3_request_timeout_ms";
-    public static final String S3_CONNECTION_TIMEOUT_MS = "s3_connection_timeout_ms";
+    public static final String USE_PATH_STYLE = "use_path_style";
+    public static final String S3_MAX_CONNECTIONS = "AWS_MAX_CONNECTIONS";
+    public static final String S3_REQUEST_TIMEOUT_MS = "AWS_REQUEST_TIMEOUT_MS";
+    public static final String S3_CONNECTION_TIMEOUT_MS = "AWS_CONNECTION_TIMEOUT_MS";
     public static final String DEFAULT_S3_MAX_CONNECTIONS = "50";
     public static final String DEFAULT_S3_REQUEST_TIMEOUT_MS = "3000";
     public static final String DEFAULT_S3_CONNECTION_TIMEOUT_MS = "1000";
 
     @SerializedName(value = "properties")
     private Map<String, String> properties;
 
-    @SerializedName(value = "usedByPolicySet")
-    private Set<String> usedByPolicySet;
+    @SerializedName(value = "referenceSet")
+    private Map<String, ReferenceType> references;

Review Comment:
   There is a compatibility problem with this modification, but `S3Resource` has not been officially used. I don't know whether compatibility is required for `S3Resource`.



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14842:
URL: https://github.com/apache/doris/pull/14842#issuecomment-1342665515

   PR approved by anyone and no changes requested.


-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
AshinGau commented on code in PR #14842:
URL: https://github.com/apache/doris/pull/14842#discussion_r1042831802


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsResource.java:
##########
@@ -0,0 +1,123 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.BaseProcResult;
+import org.apache.doris.thrift.THdfsConf;
+import org.apache.doris.thrift.THdfsParams;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HDFS resource
+ * <p>
+ * Syntax:
+ * CREATE RESOURCE "remote_hdfs"
+ * PROPERTIES
+ * (
+ * "type" = "hdfs",
+ * "fs.defaultFS" = "hdfs://10.220.147.151:8020",
+ * "hadoop.username" = "root"
+ * );
+ */
+public class HdfsResource extends Resource {
+    public static final String HADOOP_FS_PREFIX = "dfs.";
+    public static String HADOOP_FS_NAME = "fs.defaultFS";
+    // simple or kerberos
+    public static String HADOOP_USER_NAME = "hadoop.username";
+    public static String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
+    public static String HADOOP_KERBEROS_PRINCIPAL = "hadoop.kerberos.principal";
+    public static String HADOOP_KERBEROS_KEYTAB = "hadoop.kerberos.keytab";
+    public static String HADOOP_SHORT_CIRCUIT = "dfs.client.read.shortcircuit";
+    public static String HADOOP_SOCKET_PATH = "dfs.domain.socket.path";
+    public static List<String> REQUIRED_FIELDS = Collections.singletonList(HADOOP_FS_NAME);
+
+    @SerializedName(value = "properties")
+    private Map<String, String> properties;
+
+    public HdfsResource(String name) {
+        super(name, Resource.ResourceType.HDFS);
+        properties = Maps.newHashMap();
+    }
+
+    @Override
+    public void modifyProperties(Map<String, String> properties) throws DdlException {

Review Comment:
   Only `HdfsResource` and `HMSResource` have the same logic, and maybe change when implementing statement.



-- 
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


[GitHub] [doris] morningman merged pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
morningman merged PR #14842:
URL: https://github.com/apache/doris/pull/14842


-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
AshinGau commented on code in PR #14842:
URL: https://github.com/apache/doris/pull/14842#discussion_r1042834647


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Resource.java:
##########
@@ -98,6 +100,12 @@ private static Resource getResourceInstance(ResourceType type, String name) thro
             case JDBC:
                 resource = new JdbcResource(name);
                 break;
+            case HDFS:
+                resource = new HdfsResource(name);

Review Comment:
   I have registered `HdfsResource` as the subtype of `Resource` in `GsonUtils`.



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14842:
URL: https://github.com/apache/doris/pull/14842#issuecomment-1342665463

   PR approved by at least one committer and no changes requested.


-- 
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


[GitHub] [doris] hello-stephen commented on pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #14842:
URL: https://github.com/apache/doris/pull/14842#issuecomment-1338673191

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 35.38 seconds
    load time: 456 seconds
    storage size: 17123356264 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221206031121_clickbench_pr_58315.html


-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #14842: [refactor](resource) unified resource user interface

Posted by GitBox <gi...@apache.org>.
AshinGau commented on code in PR #14842:
URL: https://github.com/apache/doris/pull/14842#discussion_r1042834088


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/HMSResource.java:
##########
@@ -0,0 +1,84 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.catalog;
+
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.proc.BaseProcResult;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HMS resource
+ * <p>
+ * Syntax:
+ * CREATE RESOURCE "hive"
+ * PROPERTIES
+ * (
+ * "type" = "hms",
+ * "hive.metastore.uris" = "thrift://172.21.0.44:7004"
+ * );
+ */
+public class HMSResource extends Resource {
+    // required
+    public static final String HIVE_METASTORE_URIS = "hive.metastore.uris";

Review Comment:
   OK, I'm going to move the function of analyzing `hdfs-site.xml` and `hdfs-site.xml` into `HMSResource` when using `Resource` to `CreateCatalogStmt`. Now it is just a framework. If I move the function here, but the previous function cannot be deleted from `CreateCatalogStmt`, it will appear that the code is redundant.



-- 
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