Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YQL-16402: Implement key cache for Top and TopSort nodes #4761

Merged
merged 2 commits into from
May 30, 2024

Conversation

igormunkin
Copy link
Collaborator

@igormunkin igormunkin commented May 22, 2024

This patchset fixes the issue with the excess calculations of the sorting keys for Top/TopSort computation node. While compiling Top/TopSort 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/TopSort 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/TopSort 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.

Changelog category

  • Improvement

Copy link

github-actions bot commented May 22, 2024

2024-05-22 17:46:58 UTC Pre-commit check for 0ab9ecd has started.
2024-05-22 17:47:00 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-22 17:50:05 UTC Build successful.
2024-05-22 17:51:49 UTC Tests are running...
🔴 2024-05-22 19:54:42 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
73443 60445 0 284 12694 20

Copy link

github-actions bot commented May 22, 2024

2024-05-22 17:48:12 UTC Pre-commit check for 0ab9ecd has started.
2024-05-22 17:48:13 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-22 17:50:49 UTC Build successful.
2024-05-22 17:52:29 UTC Tests are running...
🔴 2024-05-22 20:03:09 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14454 14271 0 69 81 33

Copy link

github-actions bot commented May 22, 2024

2024-05-22 17:48:34 UTC Pre-commit check for 0ab9ecd has started.
2024-05-22 17:48:36 UTC Build linux-x86_64-release-clang14 is running...
🟢 2024-05-22 17:52:08 UTC Build successful.

@igormunkin igormunkin force-pushed the YQL-16402-keeptop-key-cache branch from 229df8b to 38dd5da Compare May 26, 2024 19:32
Copy link

github-actions bot commented May 26, 2024

2024-05-26 19:35:58 UTC Pre-commit check for f2ea5ed has started.
2024-05-26 19:38:33 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-26 19:42:27 UTC Build successful.
2024-05-26 19:42:47 UTC Tests are running...
🔴 2024-05-26 21:47:17 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14453 14307 0 58 70 18

Copy link

github-actions bot commented May 26, 2024

2024-05-27 06:40:34 UTC Pre-commit check for f2ea5ed has started.
2024-05-27 06:43:10 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-27 06:44:18 UTC Build successful.
2024-05-27 06:44:33 UTC Tests are running...
🔴 2024-05-27 08:42:51 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
73539 60803 0 22 12702 12

Copy link

github-actions bot commented May 26, 2024

2024-05-26 19:36:10 UTC Pre-commit check for f2ea5ed has started.
2024-05-26 19:38:56 UTC Build linux-x86_64-release-clang14 is running...
🟢 2024-05-26 19:43:31 UTC Build successful.

@igormunkin igormunkin force-pushed the YQL-16402-keeptop-key-cache branch from 38dd5da to b08dbd6 Compare May 29, 2024 06:51
Copy link

github-actions bot commented May 29, 2024

2024-05-29 06:54:51 UTC Pre-commit check for 44b97df has started.
2024-05-29 06:57:31 UTC Build linux-x86_64-release-clang14 is running...
🟢 2024-05-29 07:01:01 UTC Build successful.

Copy link

github-actions bot commented May 29, 2024

2024-05-29 06:54:51 UTC Pre-commit check for 44b97df has started.
2024-05-29 06:57:26 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-29 07:01:00 UTC Build successful.
2024-05-29 07:01:13 UTC Tests are running...
🔴 2024-05-29 09:20:59 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
73613 59178 0 959 13331 145

Copy link

github-actions bot commented May 29, 2024

2024-05-29 06:55:12 UTC Pre-commit check for 44b97df has started.
2024-05-29 06:57:49 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-29 07:00:44 UTC Build successful.
2024-05-29 07:01:00 UTC Tests are running...
🔴 2024-05-29 09:31:51 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14480 13786 0 463 78 153

@igormunkin igormunkin force-pushed the YQL-16402-keeptop-key-cache branch from b08dbd6 to ceecfe7 Compare May 30, 2024 04:32
Copy link

github-actions bot commented May 30, 2024

2024-05-30 04:35:43 UTC Pre-commit check for dd42bf3 has started.
2024-05-30 04:38:20 UTC Build linux-x86_64-release-clang14 is running...
🟢 2024-05-30 04:41:47 UTC Build successful.

Copy link

github-actions bot commented May 30, 2024

2024-05-30 04:35:54 UTC Pre-commit check for dd42bf3 has started.
2024-05-30 04:38:32 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-30 04:41:28 UTC Build successful.
2024-05-30 04:41:47 UTC Tests are running...
🔴 2024-05-30 06:28:17 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14399 14285 0 51 49 14

Copy link

github-actions bot commented May 30, 2024

2024-05-30 04:36:05 UTC Pre-commit check for dd42bf3 has started.
2024-05-30 04:38:47 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-30 04:42:15 UTC Build successful.
2024-05-30 04:42:28 UTC Tests are running...
🔴 2024-05-30 06:41:54 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
73571 60844 0 14 12708 5

This patch fixes the issue with the excess calculations of the sorting
keys for TopSort computation node. While compiling TopSort 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
TopSort 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 TopSort 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.
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.
@igormunkin igormunkin force-pushed the YQL-16402-keeptop-key-cache branch from ceecfe7 to 43b854b Compare May 30, 2024 13:15
@igormunkin igormunkin marked this pull request as ready for review May 30, 2024 13:18
@igormunkin igormunkin requested a review from a team as a code owner May 30, 2024 13:18
@igormunkin igormunkin changed the title YQL-16402: Implement key cache for TKeepTopWrapper YQL-16402: Implement key cache for Top/TopSort nodes May 30, 2024
@igormunkin igormunkin changed the title YQL-16402: Implement key cache for Top/TopSort nodes YQL-16402: Implement key cache for Top and TopSort nodes May 30, 2024
Copy link

github-actions bot commented May 30, 2024

2024-05-30 14:19:29 UTC Pre-commit check for a6d2f36 has started.
2024-05-30 14:21:56 UTC Build linux-x86_64-release-clang14 is running...
🟢 2024-05-30 14:26:57 UTC Build successful.

Copy link

github-actions bot commented May 30, 2024

2024-05-30 14:36:45 UTC Pre-commit check for a6d2f36 has started.
2024-05-30 14:39:21 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-30 14:41:45 UTC Build successful.
2024-05-30 14:41:55 UTC Tests are running...
🔴 2024-05-30 16:34:08 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14416 14285 0 66 52 13

Copy link

github-actions bot commented May 30, 2024

2024-05-30 14:36:49 UTC Pre-commit check for a6d2f36 has started.
2024-05-30 14:39:18 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-30 14:42:07 UTC Build successful.
2024-05-30 14:42:18 UTC Tests are running...
🔴 2024-05-30 16:30:55 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
73601 60863 0 13 12712 13

@igormunkin igormunkin merged commit f002be0 into ydb-platform:main May 30, 2024
11 of 15 checks passed
@StekPerepolnen StekPerepolnen mentioned this pull request May 31, 2024
@niksaveliev niksaveliev mentioned this pull request Jun 17, 2024
@StekPerepolnen StekPerepolnen mentioned this pull request Jun 19, 2024
@igormunkin igormunkin deleted the YQL-16402-keeptop-key-cache branch September 6, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants