voonhous commented on code in PR #17655:
URL: https://github.com/apache/hudi/pull/17655#discussion_r2692939098


##########
hudi-common/src/main/java/org/apache/hudi/stats/HoodieColumnRangeMetadata.java:
##########
@@ -38,85 +40,29 @@
  *        associated with
  */
 @SuppressWarnings("rawtype")
+@Value
 public class HoodieColumnRangeMetadata<T extends Comparable> implements 
Serializable {
-  private final String filePath;
-  private final String columnName;
-  @Nullable
-  private final T minValue;
-  @Nullable
-  private final T maxValue;
-  private final long nullCount;
-  private final long valueCount;
-  private final long totalSize;
-  private final long totalUncompressedSize;
-  private final ValueMetadata valueMetadata;
-
-  private HoodieColumnRangeMetadata(String filePath,
-                                    String columnName,
-                                    @Nullable T minValue,
-                                    @Nullable T maxValue,
-                                    long nullCount,
-                                    long valueCount,
-                                    long totalSize,
-                                    long totalUncompressedSize,
-                                    ValueMetadata valueMetadata) {
-    this.filePath = filePath;
-    this.columnName = columnName;
-    this.minValue = minValue;
-    this.maxValue = maxValue;
-    this.nullCount = nullCount;
-    this.valueCount = valueCount;
-    this.totalSize = totalSize;
-    this.totalUncompressedSize = totalUncompressedSize;
-    this.valueMetadata = valueMetadata;
-  }
-
-  public String getFilePath() {
-    return this.filePath;
-  }
-
-  public String getColumnName() {
-    return this.columnName;
-  }
 
+  String filePath;
+  String columnName;
   @Nullable
-  public T getMinValue() {
-    return this.minValue;
-  }
+  T minValue;
+  @Nullable
+  T maxValue;
+  long nullCount;
+  long valueCount;
+  long totalSize;
+  long totalUncompressedSize;
+  ValueMetadata valueMetadata;
 
   public Object getMinValueWrapped() {
     return getValueMetadata().wrapValue(getMinValue());
   }
 
-  @Nullable
-  public T getMaxValue() {
-    return this.maxValue;
-  }
-
   public Object getMaxValueWrapped() {
     return getValueMetadata().wrapValue(getMaxValue());
   }
 
-  public long getNullCount() {
-    return nullCount;
-  }
-
-  public long getValueCount() {
-    return valueCount;
-  }
-
-  public long getTotalSize() {
-    return totalSize;
-  }
-
-  public long getTotalUncompressedSize() {
-    return totalUncompressedSize;
-  }
-
-  public ValueMetadata getValueMetadata() {
-    return valueMetadata;
-  }
-
   @Override
   public boolean equals(final Object o) {

Review Comment:
   I took a look at the gitblame and found the reason for this discrepancy:
   
   <img width="996" height="778" alt="image" 
src="https://github.com/user-attachments/assets/e1675573-6681-46cf-a6ed-9e63265f5646";
 />
   
   The contract violation was introduced here:
   https://github.com/apache/hudi/pull/4352
   
   Nothing to do with performance, more of dev error i suppose? Adding Lombok 
will definitely help to prevent such cases from happening in the future!



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