[
https://issues.apache.org/jira/browse/FLINK-8550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16350339#comment-16350339
]
ASF GitHub Bot commented on FLINK-8550:
---------------------------------------
GitHub user hequn8128 opened a pull request:
https://github.com/apache/flink/pull/5404
[FLINK-8550][table] Iterate over entryset instead of keys
## What is the purpose of the change
Iterate over entrysets instead of keys when we want to get both key and
value. I went over the code in flink. Luckily, there are not many places we
need to optimize.
## Brief change log
- Iterate over entrysets instead of keys when we want to get both key and
value
## Verifying this change
This change is already covered by existing tests, such as
`OverWindowHarnessTest` for changes in `ProcTimeBoundedRangeOver`
`OverWindowITCase` for changes in `RowTimeBoundedRangeOver`
`GroupWindowITCase` for changes in `JavaUserDefinedAggFunctions`
`CorrelateITCase` for changes in `UserDefinedTableFunctions`
## 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)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hequn8128/flink 8550
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5404.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 #5404
----
commit 24a44c4c160e11f85d422b1acdfba20ea10a1a45
Author: hequn8128 <chenghequn@...>
Date: 2018-02-02T09:33:50Z
[FLINK-8550][table] Iterate over entryset instead of keys
----
> Iterate over entryset instead of keys
> -------------------------------------
>
> Key: FLINK-8550
> URL: https://issues.apache.org/jira/browse/FLINK-8550
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Reporter: Hequn Cheng
> Assignee: Hequn Cheng
> Priority: Major
>
> Iterate over entrysets instead of keys when we want to get both key and
> value.
> For example, in \{{ProcTimeBoundedRangeOver}}:
> {code:java}
> // code placeholder
> val iter = rowMapState.keys.iterator
> val markToRemove = new ArrayList[Long]()
> while (iter.hasNext) {
> val elementKey = iter.next
> if (elementKey < limit) {
> ...
> val elementsRemove = rowMapState.get(elementKey)
> ...
> }
> }
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)