hudi-agent commented on code in PR #19022:
URL: https://github.com/apache/hudi/pull/19022#discussion_r3421562802


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/profile/DeltaWriteProfile.java:
##########
@@ -93,7 +93,7 @@ protected List<SmallFile> smallFilesProfile(String 
partitionPath) {
 
   @Override
   protected long averageBytesPerRecord() {
-    long avgSize = config.getCopyOnWriteRecordSizeEstimate();
+    long avgSize = getAvgSize() > 0 ? getAvgSize() : 
config.getCopyOnWriteRecordSizeEstimate();

Review Comment:
   🤖 nit: `getAvgSize()` is invoked twice in the ternary — could you cache it 
in a local first (e.g. `long prevAvgSize = getAvgSize();`) so the intent reads 
in one pass? The sibling `WriteProfile.averageBytesPerRecord()` avoids the 
double-touch by referencing `this.avgSize` directly, which makes the fallback 
logic a bit easier to scan.
   
   <sub><i>- AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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