[core] fix RenamingSnapshotCommitTest compile error from #6778#7942
[core] fix RenamingSnapshotCommitTest compile error from #6778#7942TheR1sing3un wants to merge 1 commit into
Conversation
The new createSnapshot() helper in RenamingSnapshotCommitTest passes
a stray Map<Integer, Long> logOffsets argument as the 14th parameter
of `new Snapshot(...)`. The Snapshot constructor has no such field —
its public ctors are 20-arg and 22-arg, neither contains logOffsets —
so javac picks the nearest overload and the test source no longer
compiles ("possible lossy conversion from long to int" at line 124).
Remove the logOffsets local plus the corresponding constructor arg
(and the two now-unused imports). The remaining 20 arguments line up
with the 20-arg public Snapshot constructor.
|
@JingsongLi HI, please review it! Let's fix it! Thanks! |
|
The one failing |
JingsongLi
left a comment
There was a problem hiding this comment.
LGTM. The fix is straightforward — removing the stale logOffsets arg and unused imports so the 20-arg Snapshot ctor matches again.
One minor note: if there's an upcoming plan to add logOffsets back to Snapshot (with proper serialization), we should track that separately. But as a compile-fix this is correct.
|
Fixed in master. |
Problem
After #6778 landed,
paimon-coreno longer compiles on master:createSnapshot()builds theSnapshotvia:Snapshot(paimon-api/src/main/java/org/apache/paimon/Snapshot.java) has two public constructors — 20 args and 22 args — and neither contains alogOffsetsparameter. With the extra arg the call is 21-wide; javac picks the closest 22-arg overload and the type system then reports a misleading "long → int" mismatch on the first arg.Every PR opened against master right now hits this.
Fix
Drop the stray
logOffsetsdeclaration and the corresponding constructor argument (plus the two now-unusedjava.util.Map/java.util.HashMapimports). The remaining 20 args line up positionally with the 20-argSnapshotctor.This assumes
logOffsetswas an accidental leftover —Snapshotitself is not intended to carry a per-bucket log-offset map. If the intent of #6778 was actually to extendSnapshotwith alogOffsetsfield, that's a larger change that should land inSnapshot.java(with serialization, equals/hashCode, etc.); flag this PR and we can switch direction.Verification
CI on this branch is the source of truth — local Maven was not run. The change is mechanical (remove a never-referenced local + the matching arg + two imports) and the arg counts are spelled out above.