KarmaGYZ commented on a change in pull request #10079: [FLINK-14594] Fix matching logics of ResourceSpec/ResourceProfile/Resource considering double values URL: https://github.com/apache/flink/pull/10079#discussion_r342942942
########## File path: flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java ########## @@ -145,13 +148,15 @@ private ResourceSpec() { * @param other Reference to resource to merge in. * @return The new resource with merged values. */ - public ResourceSpec merge(ResourceSpec other) { + public ResourceSpec merge(final ResourceSpec other) { + checkNotNull(other, "Cannot merge with null resources"); + if (this.equals(UNKNOWN) || other.equals(UNKNOWN)) { return UNKNOWN; } ResourceSpec target = new ResourceSpec( - this.cpuCores + other.cpuCores, + this.cpuCores.merge(other.cpuCores).getValue(), Review comment: So we lose the precision info here? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services