Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions api/src/main/java/org/apache/iceberg/catalog/SessionCatalog.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ default boolean tableExists(SessionContext context, TableIdentifier ident) {
*/
Table loadTable(SessionContext context, TableIdentifier ident);

/**
* Load a table with the referenced-by view chain.
*
* @param context session context
* @param ident a table identifier
* @param referencedBy ordered list of view identifiers from outermost to innermost
* @return instance of {@link Table} implementation referred by {@code ident}
* @throws NoSuchTableException if the table does not exist
*/
default Table loadTable(
SessionContext context, TableIdentifier ident, List<TableIdentifier> referencedBy) {
throw new UnsupportedOperationException("Loading a table with referenced-by is not supported");
}

/**
* Drop a table, without requesting that files are immediately deleted.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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 org.apache.iceberg.Table;
import org.apache.iceberg.view.View;

/** Catalog methods for loading tables and views with a referenced-by view chain. */
public interface SupportsReferencedBy {

/**
* Load a table with the referenced-by view chain.
*
* @param identifier a table identifier
* @param referencedBy ordered list of view identifiers from outermost to innermost
* @return an iceberg table
*/
Table loadTable(TableIdentifier identifier, List<TableIdentifier> referencedBy);

/**
* Load a view with the referenced-by view chain.
*
* @param identifier a view identifier
* @param referencedBy ordered list of view identifiers from outermost to innermost
* @return an iceberg view
*/
View loadView(TableIdentifier identifier, List<TableIdentifier> referencedBy);
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ public interface ViewSessionCatalog {
*/
View loadView(SessionCatalog.SessionContext context, TableIdentifier identifier);

/**
* Load a view with the referenced-by view chain.
*
* @param context session context
* @param identifier a view identifier
* @param referencedBy ordered list of view identifiers from outermost to innermost
* @return instance of {@link View} implementation referred by the identifier
* @throws NoSuchViewException if the view does not exist
*/
default View loadView(
SessionCatalog.SessionContext context,
TableIdentifier identifier,
List<TableIdentifier> referencedBy) {
throw new UnsupportedOperationException("Loading a view with referenced-by is not supported");
}

/**
* Check whether view exists.
*
Expand Down
Loading