jerryshao commented on code in PR #8420:
URL: https://github.com/apache/gravitino/pull/8420#discussion_r2320633819
##########
core/src/main/java/org/apache/gravitino/meta/AuditInfo.java:
##########
@@ -157,11 +157,20 @@ public AuditInfo merge(AuditInfo other, boolean
overwrite) {
return this;
}
- this.creator = overwrite || this.creator == null ? other.creator : creator;
- this.createTime = overwrite || this.createTime == null ? other.createTime
: createTime;
- this.lastModifier = overwrite || this.lastModifier == null ?
other.lastModifier : lastModifier;
+ this.creator =
+ (overwrite && other.creator != null) || this.creator == null ?
other.creator : creator;
+ this.createTime =
+ (overwrite && other.createTime != null) || this.createTime == null
+ ? other.createTime
+ : createTime;
+ this.lastModifier =
+ (overwrite && other.lastModifier != null) || this.lastModifier == null
+ ? other.lastModifier
+ : lastModifier;
this.lastModifiedTime =
- overwrite || this.lastModifiedTime == null ? other.lastModifiedTime :
lastModifiedTime;
+ (overwrite && other.lastModifiedTime != null) || this.lastModifiedTime
== null
+ ? other.lastModifiedTime
+ : lastModifiedTime;
Review Comment:
This disobey the original meaning of "overwrite", I don't think the fix is
correct and necessary.
--
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]