This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Commit 6165e9d
authored
Generalizing plan execution (#1429)
<!-- A note on testing your PR -->
<!-- Basic unit test run is executed against each commit in the PR.
If you want to run a full integration test suite, you can trigger it by
commenting
with '/run-integration-tests' or '/run-it' -->
This PR extends the current Quesma workflow to allow interrupting query
execution when the execution plan contains multiple queries and we’ve
already retrieved enough results.
The idea is to split the original query into n queries with different
time ranges. If the first one (covering a 15-minute range) returns
enough results, we will stop the execution.
The problem is reproducible on `kibana_sample_data_flights` with the
following query:
```
GET /kibana_sample_data_flights/_search
{
"_source": false,
"fields": [
{
"field": "*",
"include_unmapped": "true"
},
{
"field": "@timestamp",
"format": "strict_date_optional_time"
},
{
"field": "timestamp",
"format": "strict_date_optional_time"
}
],
"highlight": {
"fields": {
"*": {}
},
"fragment_size": 2147483647,
"post_tags": [
"@/kibana-highlighted-field@"
],
"pre_tags": [
"@kibana-highlighted-field@"
]
},
"query": {
"bool": {
"filter": [
{
"range": {
"timestamp": {
"format": "strict_date_optional_time",
"gte": "2025-05-13T08:46:01.926Z",
"lte": "2025-05-13T09:01:01.926Z"
}
}
}
],
"must": [],
"must_not": [],
"should": []
}
},
"runtime_mappings": {
"hour_of_day": {
"script": {
"source": "emit(doc['timestamp'].value.getHour());"
},
"type": "long"
}
},
"script_fields": {},
"size": 500,
"sort": [
{
"timestamp": {
"format": "strict_date_optional_time",
"order": "desc",
"unmapped_type": "boolean"
}
},
{
"_doc": {
"order": "desc",
"unmapped_type": "boolean"
}
}
],
"stored_fields": [
"*"
],
"track_total_hits": false,
"version": true
}
```1 parent c2db79a commit 6165e9d
File tree
20 files changed
+569
-118
lines changed- cmd
- platform
- frontend_connectors
- model
- optimize
- parsers/elastic_query_dsl
- processors
20 files changed
+569
-118
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
977 | | - | |
| 977 | + | |
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
| 1046 | + | |
1047 | 1047 | | |
1048 | | - | |
| 1048 | + | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| 502 | + | |
502 | 503 | | |
503 | | - | |
| 504 | + | |
504 | 505 | | |
505 | | - | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
739 | 740 | | |
740 | 741 | | |
741 | 742 | | |
742 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
743 | 748 | | |
744 | 749 | | |
745 | 750 | | |
746 | 751 | | |
747 | 752 | | |
748 | 753 | | |
749 | | - | |
| 754 | + | |
750 | 755 | | |
751 | 756 | | |
752 | | - | |
| 757 | + | |
753 | 758 | | |
754 | 759 | | |
755 | 760 | | |
| |||
1802 | 1807 | | |
1803 | 1808 | | |
1804 | 1809 | | |
1805 | | - | |
| 1810 | + | |
1806 | 1811 | | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
1807 | 1816 | | |
1808 | | - | |
| 1817 | + | |
1809 | 1818 | | |
1810 | | - | |
| 1819 | + | |
1811 | 1820 | | |
1812 | 1821 | | |
1813 | 1822 | | |
1814 | 1823 | | |
1815 | 1824 | | |
1816 | 1825 | | |
1817 | 1826 | | |
1818 | | - | |
| 1827 | + | |
1819 | 1828 | | |
1820 | 1829 | | |
1821 | | - | |
| 1830 | + | |
1822 | 1831 | | |
1823 | 1832 | | |
1824 | 1833 | | |
| |||
1895 | 1904 | | |
1896 | 1905 | | |
1897 | 1906 | | |
1898 | | - | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
1899 | 1913 | | |
1900 | 1914 | | |
1901 | 1915 | | |
1902 | 1916 | | |
1903 | 1917 | | |
1904 | 1918 | | |
1905 | | - | |
| 1919 | + | |
1906 | 1920 | | |
1907 | 1921 | | |
1908 | | - | |
| 1922 | + | |
1909 | 1923 | | |
1910 | 1924 | | |
1911 | 1925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
519 | 524 | | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
| |||
669 | 675 | | |
670 | 676 | | |
671 | 677 | | |
672 | | - | |
| 678 | + | |
673 | 679 | | |
674 | 680 | | |
675 | 681 | | |
676 | 682 | | |
677 | | - | |
678 | | - | |
| 683 | + | |
| 684 | + | |
679 | 685 | | |
680 | 686 | | |
681 | 687 | | |
682 | 688 | | |
683 | 689 | | |
684 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
685 | 694 | | |
686 | 695 | | |
687 | 696 | | |
688 | 697 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
693 | 707 | | |
| 708 | + | |
694 | 709 | | |
695 | 710 | | |
696 | 711 | | |
697 | 712 | | |
698 | 713 | | |
699 | 714 | | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
| 715 | + | |
704 | 716 | | |
705 | | - | |
706 | 717 | | |
707 | 718 | | |
708 | 719 | | |
| 720 | + | |
| 721 | + | |
709 | 722 | | |
710 | | - | |
711 | 723 | | |
712 | 724 | | |
713 | 725 | | |
714 | 726 | | |
| 727 | + | |
715 | 728 | | |
716 | | - | |
| 729 | + | |
717 | 730 | | |
718 | | - | |
| 731 | + | |
719 | 732 | | |
720 | 733 | | |
721 | 734 | | |
722 | | - | |
723 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
724 | 739 | | |
| 740 | + | |
| 741 | + | |
725 | 742 | | |
726 | | - | |
727 | | - | |
728 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
729 | 753 | | |
730 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
731 | 765 | | |
732 | 766 | | |
733 | 767 | | |
734 | 768 | | |
735 | | - | |
736 | 769 | | |
737 | 770 | | |
738 | 771 | | |
| |||
762 | 795 | | |
763 | 796 | | |
764 | 797 | | |
765 | | - | |
766 | | - | |
| 798 | + | |
| 799 | + | |
767 | 800 | | |
768 | 801 | | |
769 | 802 | | |
770 | 803 | | |
771 | 804 | | |
772 | 805 | | |
773 | | - | |
| 806 | + | |
774 | 807 | | |
775 | 808 | | |
776 | | - | |
| 809 | + | |
777 | 810 | | |
778 | 811 | | |
779 | 812 | | |
| |||
790 | 823 | | |
791 | 824 | | |
792 | 825 | | |
| 826 | + | |
793 | 827 | | |
794 | 828 | | |
795 | 829 | | |
| |||
809 | 843 | | |
810 | 844 | | |
811 | 845 | | |
812 | | - | |
| 846 | + | |
813 | 847 | | |
814 | 848 | | |
815 | 849 | | |
| |||
914 | 948 | | |
915 | 949 | | |
916 | 950 | | |
| 951 | + | |
917 | 952 | | |
918 | 953 | | |
919 | 954 | | |
920 | 955 | | |
921 | 956 | | |
922 | 957 | | |
923 | 958 | | |
924 | | - | |
| 959 | + | |
925 | 960 | | |
926 | 961 | | |
927 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
144 | 142 | | |
145 | 143 | | |
146 | 144 | | |
| |||
0 commit comments