morazow commented on code in PR #3529:
URL: https://github.com/apache/fluss/pull/3529#discussion_r3474970596


##########
fluss-common/src/main/java/org/apache/fluss/config/TableConfig.java:
##########
@@ -158,7 +163,12 @@ public ArrowCompressionInfo getArrowCompressionInfo() {
 
     /** Gets the auto partition strategy of the table. */

Review Comment:
   We should also extend the javadoc here:
   
   ```
    * <p>The result is cached on first access; this assumes the underlying 
config is not
    * mutated after this {@code TableConfig} is constructed.
   ```



##########
fluss-client/src/main/java/org/apache/fluss/client/write/WriterClient.java:
##########
@@ -176,10 +176,15 @@ private void doSend(WriteRecord record, WriteCallback 
callback) {
 
             TableInfo tableInfo = record.getTableInfo();
             PhysicalTablePath physicalTablePath = 
record.getPhysicalTablePath();
-            dynamicPartitionCreator.checkAndCreatePartitionAsync(
-                    physicalTablePath,
-                    tableInfo.getPartitionKeys(),
-                    tableInfo.getTableConfig().getAutoPartitionStrategy());
+            // Skip on non-partitioned tables: the callee returns immediately 
when
+            // partitionName is null, but the expensive AutoPartitionStrategy 
argument
+            // would still be evaluated per record without this guard.
+            if (!tableInfo.getPartitionKeys().isEmpty()) {

Review Comment:
   Maybe use tableInfo.isPartitioned here?



##########
fluss-common/src/main/java/org/apache/fluss/config/TableConfig.java:
##########
@@ -158,7 +163,12 @@ public ArrowCompressionInfo getArrowCompressionInfo() {
 
     /** Gets the auto partition strategy of the table. */
     public AutoPartitionStrategy getAutoPartitionStrategy() {

Review Comment:
   Should we add test for this asserting returns same instance across calls?



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