gh-yzou commented on code in PR #1294:
URL: https://github.com/apache/polaris/pull/1294#discussion_r2027806606


##########
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:
   After talking to @HonahX, i believe the concept we really want to reuse is 
the namespace, not the identifier. Iceberg TableIdentifier and PolicyIdentifier 
can evolve independently, however, for namespace concept, we want to move 
together.
   
   This relationship is clear in the spec, however the spec generation today 
seems inlines the namespace definition, where it generates List<String> , 
instead of List<Namespace>. The fundamental solution to me seems make sure our 
code generation can generate the correct code, so that our API spec definition 
could be the source of truth. However, i can see that there might be some 
difficulties to make it work, if that is case, i am Ok with staying a modified 
version of generated code to respect the Namespace definition. And if we could 
make the code generation work correctly, we can simply remove this manually 
added change, and we are still consistent with the API spec.
   
   and + 1 on @HonahX 's point of TableIdentifier, even though their definition 
look the same today, they seems two different object to me, we probably 
shouldn't mix them together. In long term, polaris can probably come with its 
own common Identifier definition that can be used across some very Polaris 
specific object (non-table objects).  



-- 
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: issues-unsubscr...@polaris.apache.org

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

Reply via email to