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


##########
paimon-python/pypaimon/common/core_options.py:
##########
@@ -76,3 +78,19 @@ def get_split_open_file_cost(options: dict) -> int:
             cost_str = options[CoreOptions.SOURCE_SPLIT_OPEN_FILE_COST]
             return MemorySize.parse(cost_str).get_bytes()
         return MemorySize.of_mebi_bytes(4).get_bytes()
+
+    @staticmethod
+    def get_target_file_size(options: dict, has_primary_key: bool = False) -> 
int:
+        """Get target file size from options, default to 128MB for primary key 
table, 256MB for append-only table."""
+        if CoreOptions.TARGET_FILE_SIZE in options:
+            size_str = options[CoreOptions.TARGET_FILE_SIZE]
+            return MemorySize.parse(size_str).get_bytes()
+        return MemorySize.of_mebi_bytes(128 if has_primary_key else 
256).get_bytes()
+
+    @staticmethod
+    def get_blob_target_file_size(options: dict) -> int:
+        """Get blob target file size from options, default to target-file-size 
(256MB for append-only table)."""
+        if CoreOptions.BLOB_TARGET_FILE_SIZE in options:
+            size_str = options[CoreOptions.BLOB_TARGET_FILE_SIZE]
+            return MemorySize.parse(size_str).get_bytes()
+        return CoreOptions.get_target_file_size(options, has_primary_key=False)

Review Comment:
   > Is `has_primary_key` always false here?
   
   Should be yes, found schema check in schema.py. cc @leaves12138 



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