rdblue commented on PR #4575:
URL: https://github.com/apache/iceberg/pull/4575#issuecomment-1100967612

   An alternative to this that we should also consider is adding 
`SessionContext` to catalog calls. That would add an interface like this:
   
   ```java
   public interface SessionCatalog extends Catalog {
     final class SessionContext {
       private final String sessionId;
       private final String identity;
       private final String credential;
       private final Map<String, String> sessionConfig;
   
       public SessionContext(String sessionId, String identity, String 
credential, Map<String, String> sessionConfig) {
         this.sessionId = sessionId;
         this.identity = identity;
         this.credential = credential;
         this.sessionConfig = sessionConfig;
       }
   
       public String sessionId() {
         return sessionId;
       }
   
       public String identity() {
         return identity;
       }
   
       public String credential() {
         return credential;
       }
   
       public Map<String, String> sessionConfig() {
         return sessionConfig;
       }
     }
   
     void initialize(String name, Map<String, String> properties);
   
     String name();
     
     Catalog withContext(SessionContext context);
   
     List<TableIdentifier> listTables(SessionContext context, Namespace 
namespace);
   
     TableBuilder buildTable(SessionContext context, TableIdentifier ident, 
Schema schema);
   
     Table registerTable(TableIdentifier ident, String metadataFileLocation);
   
     default boolean tableExists(SessionContext context, TableIdentifier ident) 
{
       try {
         loadTable(context, ident);
         return true;
       } catch (NoSuchTableException e) {
         return false;
       }
     }
   
     Table loadTable(SessionContext context, TableIdentifier ident);
   
     boolean dropTable(SessionContext context, TableIdentifier ident);
   
     boolean purgeTable(SessionContext context, TableIdentifier ident);
   
     void renameTable(SessionContext context, TableIdentifier from, 
TableIdentifier to);
   
     void invalidateTable(SessionContext context, TableIdentifier ident);
   }
   ```


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