jerryshao commented on code in PR #8420:
URL: https://github.com/apache/gravitino/pull/8420#discussion_r2320935080
##########
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:
It is not whether the field is null or not. It is who takes the precedence.
Beside, normally it will not happen that all the fields are null based on
the current code. It only happens in your mimic case.
Anyway, this is a behavior change, and I'm not in favor of this change.
--
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]