morningman commented on code in PR #15094:
URL: https://github.com/apache/doris/pull/15094#discussion_r1049264424
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java:
##########
@@ -721,14 +752,17 @@ private void fromPackedDatetime(long packedTime) {
public void readFields(DataInput in) throws IOException {
super.readFields(in);
short dateLiteralType = in.readShort();
- fromPackedDatetime(in.readLong());
if (dateLiteralType == DateLiteralType.DATETIME.value()) {
+ fromPackedDatetime(in.readLong());
this.type = Type.DATETIME;
} else if (dateLiteralType == DateLiteralType.DATE.value()) {
+ fromPackedDatetime(in.readLong());
this.type = Type.DATE;
} else if (dateLiteralType == DateLiteralType.DATETIMEV2.value()) {
- this.type = ScalarType.createDatetimeV2Type(in.readInt());
+ fromPackedDatetimeV2(in.readLong());
+ this.type = ScalarType.createDatetimeV2Type(in.readShort());
Review Comment:
```suggestion
this.type = ScalarType.createDatetimeV2Type(in.readInt());
```
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java:
##########
@@ -690,10 +721,10 @@ public void write(DataOutput out) throws IOException {
} else if (this.type.getPrimitiveType() == PrimitiveType.DATETIMEV2) {
out.writeShort(DateLiteralType.DATETIMEV2.value());
out.writeLong(makePackedDatetimeV2());
- out.writeInt(((ScalarType) this.type).getScalarScale());
+ out.writeShort(((ScalarType) this.type).getScalarScale());
} else if (this.type.equals(Type.DATEV2)) {
out.writeShort(DateLiteralType.DATEV2.value());
- out.writeLong(makePackedDatetimeV2());
+ out.writeInt(makePackedDateV2());
Review Comment:
This will cause FE fail to restart
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]