Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Jun 24, 2024
1 parent d30650b commit b4c6685
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ public void readFields(DataInput in) throws IOException {
break;
}
case OperationType.OP_ADD_PARTITION: {
data = new PartitionPersistInfo();
((PartitionPersistInfo) data).readFields(in);
data = PartitionPersistInfo.read(in);
isRead = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ public void write(DataOutput out) throws IOException {
Text.writeString(out, GsonUtils.GSON.toJson(this));
}

public static PartitionPersistInfo read(DataInput in) throws IOException {
if (Env.getCurrentEnvJournalVersion() >= FeMetaVersion.VERSION_136) {
return GsonUtils.GSON.fromJson(Text.readString(in), PartitionPersistInfo.class);
} else {
PartitionPersistInfo info = new PartitionPersistInfo();
info.readFields(in);
return info;
}
}

public void readFields(DataInput in) throws IOException {
dbId = in.readLong();
tableId = in.readLong();
Expand Down

0 comments on commit b4c6685

Please sign in to comment.