1- //
2- // TODO: re-enable the commented tests once the Join functionality stabilizes
3- //
4-
51allFieldsReturned
62required_capability: inlinestats_v9
73
@@ -881,7 +877,6 @@ emp_no:integer | languages:integer | gender:keyword | max_lang:integer | y:keywo
881877 10014 | 5 | null | 5 | null
882878;
883879
884- // fails with AssertionError at org.elasticsearch.xpack.esql.plan.logical.Limit.writeTo(Limit.java:70)
885880groupByMultipleRenamedColumns_AndOneExpression_Last
886881required_capability: inlinestats_v9
887882
@@ -905,7 +900,6 @@ emp_no:integer | languages:integer | gender:keyword|first_name:keyword|max_lang:
90590010010 |4 |null |Duangkaew |4 |null |4 |D
906901;
907902
908- // fails with AssertionError at org.elasticsearch.xpack.esql.plan.logical.Limit.writeTo(Limit.java:70)
909903groupByMultipleRenamedColumns_AndTwoExpressions
910904required_capability: inlinestats_v9
911905
@@ -929,7 +923,6 @@ emp_no:integer | languages:integer | gender:keyword|first_name:keyword|max_lang:
92992310010 |4 |null |Duangkaew |4 |D |null |D |4
930924;
931925
932- // fails with AssertionError at org.elasticsearch.xpack.esql.plan.logical.Limit.writeTo(Limit.java:70)
933926groupByMultipleRenamedColumns_AndMultipleRenames
934927required_capability: inlinestats_v9
935928
@@ -954,7 +947,6 @@ emp_no:integer | languages:integer | gender:keyword| f:keyword |max_lang:
95494710010 |4 |null |Duangkaew |4 |null |4 |D
955948;
956949
957- // fails with AssertionError at org.elasticsearch.xpack.esql.plan.logical.Limit.writeTo(Limit.java:70)
958950groupByMultipleRenamedColumns_AndSameNameExpressionGroupingOverride
959951required_capability: inlinestats_v9
960952
@@ -1477,3 +1469,101 @@ ROW salary = 12300, emp_no = 5, gender = "F"
14771469emp_no:integer
147814705
14791471;
1472+
1473+ sortBeforeInlinestats1
1474+ required_capability: inlinestats_v9
1475+
1476+ ROW salary = 12300, emp_no = 5, gender = "F"
1477+ | EVAL salaryK = salary/1000
1478+ | SORT salaryK DESC
1479+ | INLINESTATS sum = SUM(salaryK) BY gender
1480+ | KEEP emp_no
1481+ ;
1482+
1483+ emp_no:integer
1484+ 5
1485+ ;
1486+
1487+ sortBeforeInlinestats2
1488+ required_capability: inlinestats_v9
1489+
1490+ FROM employees
1491+ | SORT emp_no
1492+ | EVAL salaryK = salary/1000
1493+ | INLINESTATS count = COUNT(*) BY salaryK
1494+ | KEEP emp_no, still_hired, count
1495+ | LIMIT 5
1496+ ;
1497+
1498+ emp_no:integer |still_hired:boolean|count:long
1499+ 10001 |true |1
1500+ 10002 |true |3
1501+ 10003 |false |2
1502+ 10004 |true |2
1503+ 10005 |true |1
1504+ ;
1505+
1506+ // fails with: java.lang.AssertionError: expected no concrete indices without data node plan
1507+ sortBeforeInlinestats3-Ignore
1508+ required_capability: inlinestats_v9
1509+
1510+ FROM employees
1511+ | SORT languages DESC
1512+ | EVAL salaryK = salary/1000
1513+ | INLINESTATS count = COUNT(*) BY salaryK
1514+ | SORT emp_no
1515+ | INLINESTATS min = MIN(MV_COUNT(languages)) BY salaryK
1516+ | KEEP emp_no, still_hired, count
1517+ | LIMIT 5
1518+ ;
1519+
1520+ emp_no:integer |still_hired:boolean|count:long
1521+ 10001 |true |1
1522+ 10002 |true |3
1523+ 10003 |false |2
1524+ 10004 |true |2
1525+ 10005 |true |1
1526+ ;
1527+
1528+ // same as `afterLookup`, swapped SORT position
1529+ sortBeforeInlinestatsAndLookupJoin
1530+ required_capability: inlinestats_v9
1531+ required_capability: join_lookup_v12
1532+
1533+ FROM airports
1534+ | EVAL backup_scalerank = scalerank
1535+ | RENAME scalerank AS language_code
1536+ | SORT abbrev DESC
1537+ | LOOKUP JOIN languages_lookup ON language_code
1538+ | RENAME language_name as scalerank
1539+ | DROP language_code
1540+ | INLINESTATS count=COUNT(*) BY scalerank
1541+ | KEEP abbrev, *scalerank
1542+ | LIMIT 5
1543+ ;
1544+
1545+ abbrev:keyword |backup_scalerank:integer| scalerank:keyword
1546+ null |8 |null
1547+ null |8 |null
1548+ null |8 |null
1549+ ZRH |3 |Spanish
1550+ ZNZ |4 |German
1551+ ;
1552+
1553+ // same as `shadowingAggregateByNextGrouping`, swapped SORT position
1554+ sortBeforeInlinestats
1555+ required_capability: inlinestats_v9
1556+
1557+ FROM employees
1558+ | KEEP gender, languages, emp_no, salary
1559+ | SORT emp_no
1560+ | INLINESTATS gender = count_distinct(gender) BY languages
1561+ | INLINESTATS avg(salary) BY gender
1562+ | LIMIT 3
1563+ ;
1564+
1565+ emp_no:integer |salary:integer |languages:integer|avg(salary):double|gender:long
1566+ 10001 |57305 |2 |48248.55 |2
1567+ 10002 |56371 |5 |48248.55 |2
1568+ 10003 |61805 |4 |48248.55 |2
1569+ ;
0 commit comments