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 f1cfdde commit 1849f6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ public static CatalogRecycleBin read(DataInput in) throws IOException {
return bin;
}

@Override
public void gsonPostProcess() throws IOException {
updateDbInfoForLowerVersion();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,32 +375,10 @@ public static String toString(List<LiteralExpr> keys) {
return builder.toString();
}

// only used by ut
@Override
public void write(DataOutput out) throws IOException {
int count = keys.size();
if (count != types.size()) {
throw new IOException("Size of keys and types are not equal");
}

out.writeInt(count);
for (int i = 0; i < count; i++) {
PrimitiveType type = types.get(i);
if (keys.get(i).isNullLiteral()) {
Text.writeString(out, Type.NULL.toString());
} else {
Text.writeString(out, type.toString());
}

if (keys.get(i) == MaxLiteral.MAX_VALUE) {
out.writeBoolean(true);
} else if (keys.get(i).isNullLiteral()) {
out.writeBoolean(false);
Text.writeString(out, type.toString());
} else {
out.writeBoolean(false);
Text.writeString(out, GsonUtils.GSON.toJson(keys.get(i)));
}
}
Text.writeString(out, GsonUtils.GSON.toJson(this));
}

public void readFields(DataInput in) throws IOException {
Expand Down Expand Up @@ -470,9 +448,13 @@ public void readFields(DataInput in) throws IOException {
}

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

@Override
Expand Down

0 comments on commit 1849f6b

Please sign in to comment.