cloud-fan commented on PR #50137:
URL: https://github.com/apache/spark/pull/50137#issuecomment-2703005083

   From a user's point of view, I feel the new API is a bit cumbersome as I 
need to implement my own `TableBuilder`, and then implement `buildTable` to 
return it. `TableBuilder` has quite a few methods to implement and previously I 
just needed to implement a simple `createTable` method.
   
   Thinking about it again, we want to make the API easier to implement, but 
not easier to invoke (only invoked by Spark internally). So the builder pattern 
doesn't seem to be a good choice here. I think we just need to have an 
interface to hold all table information, and let createTable/replaceTable take 
it instead of many parameters. For example:
   ```
   interface TableInfo {
     Column[] columns;
     Transform[] partitions;
     ...
   }
   
   interface TableCatalog ... {
     Table createTable(Identifier ident, TableInfo t);
   }
   ```
   
   Users just need to implement one method, and we can keep adding new fields 
in `TableInfo`, which is backward compatible as users only need to call its 
methods, but no need to implement it.


-- 
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: reviews-unsubscr...@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to