-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YQL-16402: Reimplement key extractor for Top node
This patch fixes the issue with the excess calculations of the sorting keys for Top computation node. While compiling Top runtime node, the input source (either stream or flow) is transformed into {key: item} mapping, and the resulting iterable is processed by both KeepTop and Top nodes using the trivial key extractor, that obtains the key value as the first component from the item of the resulting iterable. The result yielded by Top is transformed back returning only the second component from the item of the mapping being processed. As a result of the changed described above, <keyExtractor> callable is invoked once for each item of the given input iterable. A static UDF module is used to test the fix. It provides an echo function, that increments TLS counter each time being called. When the processing is finished, the value of this counter is compared with the number of the items in the Stream/Flow.
- Loading branch information
1 parent
5ded4db
commit 43b854b
Showing
2 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters