You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by lamber-ken <gi...@git.apache.org> on 2018/07/12 06:58:58 UTC
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
GitHub user lamber-ken opened a pull request:
https://github.com/apache/flink/pull/6321
[FLINK-9829] fix the wrapper classes be compared by symbol of '==' directly in BigDecSerializer.java
## What is the purpose of the change
- fix the wrapper classes be compared by symbol of '==' directly in BigDecSerializer.java
## Brief change log
- The wrapper classes should be compared by equals method rather than by symbol of '==' directly
- should use BigDecimal's equal method
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (JavaDocs)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lamber-ken/flink FLINK-9829
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/6321.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #6321
----
commit cebe6b9d6f4c812c336581545623f430d5cb0b58
Author: lamber-ken <!...@...>
Date: 2018-07-12T06:53:53Z
[FLINK-9829] fix the wrapper classes be compared by symbol of '==' directly in BigDecSerializer.java
----
---
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/6321#discussion_r202335561
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecSerializer.java ---
@@ -69,17 +69,17 @@ public void serialize(BigDecimal record, DataOutputView target) throws IOExcepti
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
--- End diff --
The code adheres to the API provided by `BigInteger`, so this is fine as far as I'm concerned.
It would be a different story if, say, we would use reference equality for `2`, since that relies an implementation detail that isn't exposed anywhere.
---
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/6321#discussion_r202056979
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecSerializer.java ---
@@ -69,17 +69,17 @@ public void serialize(BigDecimal record, DataOutputView target) throws IOExcepti
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
--- End diff --
did you see this comment?
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on the issue:
https://github.com/apache/flink/pull/6321
The commit message includes the JIRA id now.
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/6321
This would be clearly not a hotfix. As per the pull request template, contributors should use hotfixes mainly for typos and JavaDoc updates.
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on the issue:
https://github.com/apache/flink/pull/6321
@zentol, @StephanEwen, thank you for explaining the question about hotfixes. I was not very clear about whether to create a jira or hotfix before.
---
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on a diff in the pull request:
https://github.com/apache/flink/pull/6321#discussion_r202566500
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecSerializer.java ---
@@ -69,17 +69,17 @@ public void serialize(BigDecimal record, DataOutputView target) throws IOExcepti
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
--- End diff --
right, the second section code was not exposed anywhere, and just modify the first section code now
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on the issue:
https://github.com/apache/flink/pull/6321
@StephanEwen, if the original authors of the code had an intention of writing the code as it is now,
I'll follow your advice and leave it as it is.
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on the issue:
https://github.com/apache/flink/pull/6321
@zentol, hi, there are two ways to contribute to flink project.
one is create a `jira FLINK-XXXX` , another is `[hotfix] XXX`.
for example, fix some checkstyle or code refactor, how to choose the best way to contribute ?
---
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken commented on a diff in the pull request:
https://github.com/apache/flink/pull/6321#discussion_r202075894
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigDecSerializer.java ---
@@ -69,17 +69,17 @@ public void serialize(BigDecimal record, DataOutputView target) throws IOExcepti
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
--- End diff --
No.
In terms of performance, this is OK, but from the point of view of language specification, may be it's better to use `equals` method.
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:
https://github.com/apache/flink/pull/6321
depends on how extensive they are, hotfixes should only be used very small changes.
---
[GitHub] flink pull request #6321: [FLINK-9829] fix the wrapper classes be compared b...
Posted by lamber-ken <gi...@git.apache.org>.
Github user lamber-ken closed the pull request at:
https://github.com/apache/flink/pull/6321
---
[GitHub] flink issue #6321: [FLINK-9829] fix the wrapper classes be compared by symbo...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/6321
Is the issue addressed here a bug?
If not, and if it seems that the original authors of the code had an intention of writing the code as it is now, I would suggest to leave it as it is.
---