Skip to content

Commit

Permalink
[fix](downgrade) partition key should write upper case null type to i…
Browse files Browse the repository at this point in the history
…mage (apache#39776)
  • Loading branch information
morrySnow authored Aug 22, 2024
1 parent 40500f2 commit 29898d0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public void write(DataOutput out) throws IOException {
for (int i = 0; i < count; i++) {
PrimitiveType type = types.get(i);
if (keys.get(i).isNullLiteral()) {
Text.writeString(out, Type.NULL.toString());
Text.writeString(out, PrimitiveType.NULL_TYPE.toString());
} else {
Text.writeString(out, type.toString());
}
Expand All @@ -396,11 +396,11 @@ public void write(DataOutput out) throws IOException {
public void readFields(DataInput in) throws IOException {
int count = in.readInt();
for (int i = 0; i < count; i++) {
PrimitiveType type = PrimitiveType.valueOf(Text.readString(in).toUpperCase());
PrimitiveType type = PrimitiveType.valueOf(Text.readString(in));
boolean isMax = in.readBoolean();
if (type == PrimitiveType.NULL_TYPE) {
String realType = StringLiteral.read(in).getStringValue();
type = PrimitiveType.valueOf(realType.toUpperCase());
type = PrimitiveType.valueOf(realType);
types.add(type);
keys.add(NullLiteral.create(Type.fromPrimitiveType(type)));
continue;
Expand Down

0 comments on commit 29898d0

Please sign in to comment.