Skip to content

Commit

Permalink
[BugFix] Fix select partition meta error in lake table (#50190)
Browse files Browse the repository at this point in the history
Signed-off-by: starrocks-xupeng <[email protected]>
  • Loading branch information
starrocks-xupeng committed Aug 26, 2024
1 parent 43fb771 commit f4271a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ public void handleLoadingFinished(PartitionIdentifier partition, long version, l
}
v.setCurrentVersion(currentVersion);
v.setCompactionScore(compactionScore);
if (v.getCompactionVersion() == null) {
v.setCompactionVersion(new PartitionVersion(0, versionTime));
}
return v;
});
if (LOG.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public int getValue() {

public PartitionStatistics(PartitionIdentifier partition) {
this.partition = partition;
this.compactionVersion = null;
this.compactionVersion = new PartitionVersion(0 /* version */, System.currentTimeMillis() /* createTime */);
this.nextCompactionTime = 0;
this.punishFactor = 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ public void testPunishFactor() {
statistics.setCompactionScoreAndAdjustPunishFactor(q4);
assertEquals(1, statistics.getPunishFactor());
}

@Test
public void testGetCompactionVersion() {
PartitionStatistics statistics = new PartitionStatistics(new PartitionIdentifier(100, 200, 300));
assertEquals(0, statistics.getCompactionVersion().getVersion());
}
}

0 comments on commit f4271a0

Please sign in to comment.