XiaoHongbo-Hope commented on code in PR #7815:
URL: https://github.com/apache/paimon/pull/7815#discussion_r3224381042


##########
paimon-python/pypaimon/write/table_commit.py:
##########
@@ -99,8 +108,19 @@ def truncate_partitions(self, partitions: List[Dict[str, 
str]]) -> None:
         self._check_committed()
         self.file_store_commit.drop_partitions(partitions, 
BATCH_COMMIT_IDENTIFIER)
 
+    def _check_committed(self):
+        if self.batch_committed:
+            raise RuntimeError("BatchTableCommit only supports one-time 
committing.")
+        self.batch_committed = True
+
 
 class StreamTableCommit(TableCommit):
+    """Stream-mode commit; reusable across many commit rounds.
+
+    Each call must be tagged with a monotonically increasing
+    ``commit_identifier`` — analogous to
+    :meth:`StreamTableWrite.prepare_commit`.
+    """
 
     def commit(self, commit_messages: List[CommitMessage], commit_identifier: 
int = BATCH_COMMIT_IDENTIFIER):

Review Comment:
   Should we update the default value of `commit_identifier` too?



##########
paimon-python/pypaimon/write/table_commit.py:
##########
@@ -99,8 +108,19 @@ def truncate_partitions(self, partitions: List[Dict[str, 
str]]) -> None:
         self._check_committed()
         self.file_store_commit.drop_partitions(partitions, 
BATCH_COMMIT_IDENTIFIER)
 
+    def _check_committed(self):
+        if self.batch_committed:
+            raise RuntimeError("BatchTableCommit only supports one-time 
committing.")
+        self.batch_committed = True
+
 
 class StreamTableCommit(TableCommit):
+    """Stream-mode commit; reusable across many commit rounds.
+
+    Each call must be tagged with a monotonically increasing
+    ``commit_identifier`` — analogous to
+    :meth:`StreamTableWrite.prepare_commit`.
+    """
 
     def commit(self, commit_messages: List[CommitMessage], commit_identifier: 
int = BATCH_COMMIT_IDENTIFIER):

Review Comment:
   Should we update the default value of `commit_identifier` too?



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

Reply via email to