tsreaper commented on code in PR #550: URL: https://github.com/apache/flink-table-store/pull/550#discussion_r1116726949
########## flink-table-store-core/src/main/java/org/apache/flink/table/store/table/Table.java: ########## @@ -84,6 +97,58 @@ public interface Table extends Serializable { /** Create a {@link TableRead} to read {@link Split}s. */ TableRead newRead(); + /** Create a {@link TableWrite} to write {@link InternalRow}s. */ + TableWrite newWrite(String commitUser); + + /** + * Create a {@link TableWrite} to write {@link InternalRow}s. + * + * <p>NOTE: This method will generate random commitUser. If you want to generate multiple + * commits, please use commitUser that is consistent with {@link #newCommit}. + */ + default TableWrite newWrite() { + return newWrite(UUID.randomUUID().toString()); + } Review Comment: Considering that `commitUser` is needed by both `TableWrite` and `TableCommit`, and we also have a similar case that `predicate` is needed by both `TableScan` and `TableRead`, why not introduce a `ReadBuilder` and a `WriteBuilder`? We can set common variables in the builders and extract `TableWrite` or `TableCommit` from them. -- 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...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org