Skip to content

Commit 9cfe5ab

Browse files
committed
Rename and fix test after rebase
1 parent 3f49981 commit 9cfe5ab

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

core/src/main/java/org/apache/iceberg/PartitionStats.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,14 @@ public int equalityDeleteFileCount() {
7979
}
8080

8181
/**
82-
* @deprecated since 1.9.0, will be removed in 1.10.0, use {@link #totalRecordCountOptional()}
83-
* instead.
82+
* @deprecated since 1.9.0, will be removed in 1.10.0, use {@link #totalRecords()} instead.
8483
*/
8584
@Deprecated
8685
public long totalRecordCount() {
8786
return totalRecordCount == null ? 0 : totalRecordCount;
8887
}
8988

90-
public Long totalRecordCountOptional() {
89+
public Long totalRecords() {
9190
return totalRecordCount;
9291
}
9392

core/src/test/java/org/apache/iceberg/TestPartitionStatsUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ private static void computeAndValidatePartitionStats(Table testTable, Tuple... e
572572
PartitionStats::positionDeleteFileCount,
573573
PartitionStats::equalityDeleteRecordCount,
574574
PartitionStats::equalityDeleteFileCount,
575-
PartitionStats::totalRecordCountOptional,
575+
PartitionStats::totalRecords,
576576
PartitionStats::lastUpdatedAt,
577577
PartitionStats::lastUpdatedSnapshotId)
578578
.containsExactlyInAnyOrder(expectedValues);

data/src/test/java/org/apache/iceberg/data/TestPartitionStatsHandler.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,12 @@ public void testOptionalFieldsWriting() throws Exception {
270270
PartitionStats::positionDeleteFileCount,
271271
PartitionStats::equalityDeleteRecordCount,
272272
PartitionStats::equalityDeleteFileCount,
273-
PartitionStats::totalRecordCount,
273+
PartitionStats::totalRecords,
274274
PartitionStats::lastUpdatedAt,
275275
PartitionStats::lastUpdatedSnapshotId)
276276
.isEqualTo(
277277
Arrays.asList(
278-
0L, 0, 0L, 0, 0L, null, null)); // null counters must be initialized to zero.
278+
0L, 0, 0L, 0, null, null, null)); // null counters must be initialized to zero.
279279

280280
PartitionStatisticsFile statisticsFile =
281281
PartitionStatsHandler.writePartitionStatsFile(testTable, 42L, dataSchema, expected);
@@ -352,7 +352,7 @@ public void testPartitionStats() throws Exception {
352352
0,
353353
0L,
354354
0,
355-
0L,
355+
null,
356356
snapshot1.timestampMillis(),
357357
snapshot1.snapshotId()),
358358
Tuple.tuple(
@@ -365,7 +365,7 @@ public void testPartitionStats() throws Exception {
365365
0,
366366
0L,
367367
0,
368-
0L,
368+
null,
369369
snapshot1.timestampMillis(),
370370
snapshot1.snapshotId()),
371371
Tuple.tuple(
@@ -378,7 +378,7 @@ public void testPartitionStats() throws Exception {
378378
0,
379379
0L,
380380
0,
381-
0L,
381+
null,
382382
snapshot1.timestampMillis(),
383383
snapshot1.snapshotId()),
384384
Tuple.tuple(
@@ -391,7 +391,7 @@ public void testPartitionStats() throws Exception {
391391
0,
392392
0L,
393393
0,
394-
0L,
394+
null,
395395
snapshot1.timestampMillis(),
396396
snapshot1.snapshotId()));
397397

@@ -416,7 +416,7 @@ public void testPartitionStats() throws Exception {
416416
0,
417417
eqDeletes.recordCount(),
418418
1,
419-
0L,
419+
null,
420420
snapshot3.timestampMillis(),
421421
snapshot3.snapshotId()),
422422
Tuple.tuple(
@@ -429,7 +429,7 @@ public void testPartitionStats() throws Exception {
429429
0,
430430
0L,
431431
0,
432-
0L,
432+
null,
433433
snapshot1.timestampMillis(),
434434
snapshot1.snapshotId()),
435435
Tuple.tuple(
@@ -442,7 +442,7 @@ public void testPartitionStats() throws Exception {
442442
1,
443443
0L,
444444
0,
445-
0L,
445+
null,
446446
snapshot2.timestampMillis(),
447447
snapshot2.snapshotId()),
448448
Tuple.tuple(
@@ -455,7 +455,7 @@ public void testPartitionStats() throws Exception {
455455
0,
456456
0L,
457457
0,
458-
0L,
458+
null,
459459
snapshot1.timestampMillis(),
460460
snapshot1.snapshotId()));
461461
}
@@ -517,7 +517,7 @@ private static void computeAndValidatePartitionStats(
517517
PartitionStats::positionDeleteFileCount,
518518
PartitionStats::equalityDeleteRecordCount,
519519
PartitionStats::equalityDeleteFileCount,
520-
PartitionStats::totalRecordCount,
520+
PartitionStats::totalRecords,
521521
PartitionStats::lastUpdatedAt,
522522
PartitionStats::lastUpdatedSnapshotId)
523523
.containsExactlyInAnyOrder(expectedValues);
@@ -591,7 +591,7 @@ private static boolean isEqual(
591591
&& stats1.positionDeleteFileCount() == stats2.positionDeleteFileCount()
592592
&& stats1.equalityDeleteRecordCount() == stats2.equalityDeleteRecordCount()
593593
&& stats1.equalityDeleteFileCount() == stats2.equalityDeleteFileCount()
594-
&& stats1.totalRecordCount() == stats2.totalRecordCount()
594+
&& Objects.equals(stats1.totalRecords(), stats2.totalRecords())
595595
&& Objects.equals(stats1.lastUpdatedAt(), stats2.lastUpdatedAt())
596596
&& Objects.equals(stats1.lastUpdatedSnapshotId(), stats2.lastUpdatedSnapshotId());
597597
}

0 commit comments

Comments
 (0)