singhpk234 commented on code in PR #13979:
URL: https://github.com/apache/iceberg/pull/13979#discussion_r2934364948


##########
api/src/main/java/org/apache/iceberg/catalog/ContextAwareCatalog.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.iceberg.catalog;
+
+import java.util.List;
+import java.util.Map;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.iceberg.exceptions.NoSuchViewException;
+import org.apache.iceberg.view.View;
+
+/**
+ * Extension interface for Catalog that supports context-aware loading. This 
enables passing
+ * additional context (such as view information) when loading tables or views.
+ */
+public interface ContextAwareCatalog {
+
+  /** Context key for the view identifier chain that references a table. */
+  String VIEW_IDENTIFIER_KEY = "view.referenced-by";
+
+  /**
+   * Load a table with additional context information.
+   *
+   * <p>Common context keys:
+   *
+   * <ul>
+   *   <li>{@link #VIEW_IDENTIFIER_KEY}: A {@link List} of {@link 
TableIdentifier} representing the
+   *       chain of views that reference this table. The list is ordered from 
outermost view first
+   *       to innermost view last. For a single view reference, the list 
contains one element.
+   * </ul>
+   *
+   * <p>The default implementation throws {@link 
UnsupportedOperationException}. Implementations
+   * that support context-aware table loading should override this method.
+   *
+   * @param identifier the table identifier to load
+   * @param loadingContext additional context information as key-value pairs
+   * @return the loaded table
+   * @throws NoSuchTableException if the table does not exist
+   */
+  default Table loadTable(TableIdentifier identifier, Map<String, Object> 
loadingContext)
+      throws NoSuchTableException {

Review Comment:
   Its a well defined exception, though you are right, loadTable in the catalog 
api doesn't marks it explicitly, may be a convention to not give RTE in 
signature, good to be consitent then



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to