Skip to content

Commit 8d6c014

Browse files
committed
update based on comments
1 parent a128ae0 commit 8d6c014

File tree

16 files changed

+466
-308
lines changed

16 files changed

+466
-308
lines changed

api/src/main/java/org/apache/iceberg/FieldMetrics.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,45 @@ public FieldMetrics(int id,
4747
this.upperBound = upperBound;
4848
}
4949

50-
public int getId() {
50+
/**
51+
* Returns the id of the field that the metrics within this class are associated with.
52+
*/
53+
public int id() {
5154
return id;
5255
}
5356

54-
public long getValueCount() {
57+
/**
58+
* Returns the number of all values, including nulls, NaN and repeated, for the given field.
59+
*/
60+
public long valueCount() {
5561
return valueCount;
5662
}
5763

58-
public long getNullValueCount() {
64+
/**
65+
* Returns the number of null values for this field.
66+
*/
67+
public long nullValueCount() {
5968
return nullValueCount;
6069
}
6170

62-
public long getNanValueCount() {
71+
/**
72+
* Returns the number of NaN values for this field. Will only be non-0 if this field is a double or float field.
73+
*/
74+
public long nanValueCount() {
6375
return nanValueCount;
6476
}
6577

66-
public ByteBuffer getLowerBound() {
78+
/**
79+
* Returns the lower bound value of this field.
80+
*/
81+
public ByteBuffer lowerBound() {
6782
return lowerBound;
6883
}
6984

70-
public ByteBuffer getUpperBound() {
85+
/**
86+
* Returns the upper bound value of this field.
87+
*/
88+
public ByteBuffer upperBound() {
7189
return upperBound;
7290
}
7391
}

api/src/main/java/org/apache/iceberg/Metrics.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public class Metrics implements Serializable {
4444
public Metrics() {
4545
}
4646

47-
// for temporary backward compatibility, will be removed when all writers support nanValueCounts
47+
/**
48+
* @deprecated will be removed in 0.12.0; use {@link #Metrics(Long, Map, Map, Map, Map)} instead.
49+
*/
50+
@Deprecated
4851
public Metrics(Long rowCount,
4952
Map<Integer, Long> columnSizes,
5053
Map<Integer, Long> valueCounts,
@@ -67,7 +70,10 @@ public Metrics(Long rowCount,
6770
this.nanValueCounts = nanValueCounts;
6871
}
6972

70-
// for temporary backward compatibility, will be removed when all writers support nanValueCounts
73+
/**
74+
* @deprecated will be removed in 0.12.0; use {@link #Metrics(Long, Map, Map, Map, Map, Map, Map)} instead.
75+
*/
76+
@Deprecated
7177
public Metrics(Long rowCount,
7278
Map<Integer, Long> columnSizes,
7379
Map<Integer, Long> valueCounts,
@@ -135,7 +141,7 @@ public Map<Integer, Long> nullValueCounts() {
135141
}
136142

137143
/**
138-
* Get the number of NaN values for all fields in a file.
144+
* Get the number of NaN values for all float and double fields in a file.
139145
*
140146
* @return a Map of fieldId to the number of NaN counts
141147
*/

0 commit comments

Comments
 (0)