HonahX commented on code in PR #1294: URL: https://github.com/apache/polaris/pull/1294#discussion_r2027788989
########## api/polaris-catalog-service/src/main/java/org/apache/polaris/service/types/PolicyIdentifier.java: ########## @@ -0,0 +1,122 @@ +/* + * 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.polaris.service.types; + +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import java.util.Arrays; +import java.util.Locale; +import java.util.Objects; +import org.apache.iceberg.catalog.Namespace; +import org.apache.iceberg.catalog.TableIdentifier; + +public class PolicyIdentifier { + + private static final Splitter DOT = Splitter.on('.'); + + private final Namespace namespace; + private final String name; + + public static PolicyIdentifier of(String... names) { Review Comment: Both PolicyIdentifier and TableIdentifier currently include the same fields (namespace and name), but I still feel that mixing the name can cause confusion. For example, having a method like: ```java createPolicy(TableIdentifier policyIdentifier, ...) ``` seems super weird. For now, I can change this to a modified generated version of `PolicyIdentifier`. In the future, we can revisit our design and consider a more general abstraction for all identifiers (e.g., for objects like Volume) to improve consistency across the code base. WDYT? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
