LinMingQiang commented on code in PR #5121: URL: https://github.com/apache/paimon/pull/5121#discussion_r1967610306
########## paimon-common/src/main/java/org/apache/paimon/CoreOptions.java: ########## @@ -1947,9 +1947,14 @@ public long writeBufferSize() { return options.get(WRITE_BUFFER_SIZE).getBytes(); } - public boolean writeBufferSpillable(boolean usingObjectStore, boolean isStreaming) { + public boolean writeBufferSpillable( + boolean usingObjectStore, boolean isStreaming, boolean hasPrimaryKey) { // if not streaming mode, we turn spillable on by default. - return options.getOptional(WRITE_BUFFER_SPILLABLE).orElse(usingObjectStore || !isStreaming); + return options.getOptional(WRITE_BUFFER_SPILLABLE) + .orElse( + usingObjectStore + || !isStreaming + || targetFileSize(hasPrimaryKey) > writeBufferSize()); Review Comment: nice catch. -- 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...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org