Skip to content

Commit 1ef55bb

Browse files
authored
ESQL: Rename command from INLINESTATS to INLINE STATS (#134827)
This simply renames `INLINESTATS` to `INLINE STATS`. The `INLINESTATS` is still kept working for now, but it emits a deprecation warning. Closes #133998
1 parent 75ed968 commit 1ef55bb

File tree

62 files changed

+3531
-3231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3531
-3231
lines changed

docs/reference/query-languages/esql/_snippets/commands/examples/inlinestats.csv-spec/avg-salaries-where.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
```esql
44
FROM employees
55
| KEEP emp_no, salary
6-
| INLINESTATS avg_lt_50 = ROUND(AVG(salary)) WHERE salary < 50000,
7-
avg_lt_60 = ROUND(AVG(salary)) WHERE salary >=50000 AND salary < 60000,
8-
avg_gt_60 = ROUND(AVG(salary)) WHERE salary >= 60000
6+
| INLINE STATS avg_lt_50 = ROUND(AVG(salary)) WHERE salary < 50000,
7+
avg_lt_60 = ROUND(AVG(salary)) WHERE salary >=50000 AND salary < 60000,
8+
avg_gt_60 = ROUND(AVG(salary)) WHERE salary >= 60000
99
```
1010

1111
| emp_no:integer | salary:integer | avg_lt_50:double | avg_lt_60:double | avg_gt_60:double |

docs/reference/query-languages/esql/_snippets/commands/examples/inlinestats.csv-spec/max-salary-without-by.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
```esql
44
FROM employees
55
| KEEP emp_no, languages, salary
6-
| INLINESTATS max_salary = MAX(salary)
6+
| INLINE STATS max_salary = MAX(salary)
77
```
88

99
| emp_no:integer | languages:integer | salary:integer | max_salary:integer |

docs/reference/query-languages/esql/_snippets/commands/examples/inlinestats.csv-spec/max-salary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
```esql
44
FROM employees
55
| KEEP emp_no, languages, salary
6-
| INLINESTATS max_salary = MAX(salary) BY languages
6+
| INLINE STATS max_salary = MAX(salary) BY languages
77
```
88

99
| emp_no:integer | salary:integer | max_salary:integer | languages:integer |

docs/reference/query-languages/esql/_snippets/commands/examples/inlinestats.csv-spec/multi-agg-multi-grouping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM employees
66
| KEEP emp_no, languages, salary, hire_date
77
| EVAL tenure = DATE_DIFF("year", hire_date, now())
88
| DROP hire_date
9-
| INLINESTATS avg_salary = AVG(salary), count = count(*) BY languages, tenure
9+
| INLINE STATS avg_salary = AVG(salary), count = count(*) BY languages, tenure
1010
```
1111

1212
| emp_no:integer | salary:integer | avg_salary:double | count:long | languages:integer | tenure:integer |

docs/reference/query-languages/esql/kibana/definition/commands/inline_stats.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@
5151
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.ENABLE_FORK_FOR_REMOTE_INDICES;
5252
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.ENABLE_LOOKUP_JOIN_ON_REMOTE;
5353
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.FORK_V9;
54-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS;
55-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_SUPPORTS_REMOTE;
56-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_V11;
54+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINE_STATS;
55+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINE_STATS_SUPPORTS_REMOTE;
5756
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V12;
5857
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_PLANNING_V1;
5958
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.METADATA_FIELDS_REMOTE_TEST;
@@ -140,16 +139,15 @@ protected void shouldSkipTest(String testName) throws IOException {
140139
assumeFalse("can't test with _index metadata", (remoteMetadata == false) && hasIndexMetadata(testCase.query));
141140
Version oldVersion = Version.min(Clusters.localClusterVersion(), Clusters.remoteClusterVersion());
142141
assumeTrue("Test " + testName + " is skipped on " + oldVersion, isEnabled(testName, instructions, oldVersion));
143-
if (testCase.requiredCapabilities.contains(INLINESTATS.capabilityName())
144-
|| testCase.requiredCapabilities.contains(INLINESTATS_V11.capabilityName())
142+
if (testCase.requiredCapabilities.contains(INLINE_STATS.capabilityName())
145143
|| testCase.requiredCapabilities.contains(JOIN_PLANNING_V1.capabilityName())) {
146144
assumeTrue(
147-
"INLINESTATS in CCS not supported for this version",
148-
hasCapabilities(adminClient(), List.of(INLINESTATS_SUPPORTS_REMOTE.capabilityName()))
145+
"INLINE STATS in CCS not supported for this version",
146+
hasCapabilities(adminClient(), List.of(INLINE_STATS_SUPPORTS_REMOTE.capabilityName()))
149147
);
150148
assumeTrue(
151-
"INLINESTATS in CCS not supported for this version",
152-
hasCapabilities(remoteClusterClient(), List.of(INLINESTATS_SUPPORTS_REMOTE.capabilityName()))
149+
"INLINE STATS in CCS not supported for this version",
150+
hasCapabilities(remoteClusterClient(), List.of(INLINE_STATS_SUPPORTS_REMOTE.capabilityName()))
153151
);
154152
}
155153
if (testCase.requiredCapabilities.contains(JOIN_LOOKUP_V12.capabilityName())) {

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/RestEsqlIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ public void assertDriverData(Map<String, Object> driverMetadata, Map<String, Obj
466466

467467
@AwaitsFix(bugUrl = "disabled until JOIN infrastructrure properly lands")
468468
public void testInlineStatsProfile() throws IOException {
469-
assumeTrue("INLINESTATS only available on snapshots", Build.current().isSnapshot());
469+
assumeTrue("INLINE STATS only available on snapshots", Build.current().isSnapshot());
470470
indexTimestampData(1);
471471

472-
RequestObjectBuilder builder = requestObjectBuilder().query(fromIndex() + " | INLINESTATS AVG(value) | SORT value ASC");
472+
RequestObjectBuilder builder = requestObjectBuilder().query(fromIndex() + " | INLINE STATS AVG(value) | SORT value ASC");
473473
builder.profile(true);
474474
if (Build.current().isSnapshot()) {
475475
// Lock to shard level partitioning, so we get consistent profile output

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ public void testComplexFieldNames() throws IOException {
12121212
}
12131213

12141214
/**
1215-
* INLINESTATS <strong>can</strong> group on {@code NOW()}. It's a little silly, but
1215+
* INLINE STATS <strong>can</strong> group on {@code NOW()}. It's a little silly, but
12161216
* doing something like {@code DATE_TRUNC(1 YEAR, NOW() - 1970-01-01T00:00:00Z)} is
12171217
* much more sensible. But just grouping on {@code NOW()} is enough to test this.
12181218
* <p>
@@ -1221,11 +1221,11 @@ public void testComplexFieldNames() throws IOException {
12211221
* </p>
12221222
*/
12231223
public void testInlineStatsNow() throws IOException {
1224-
assumeTrue("INLINESTATS only available on snapshots", Build.current().isSnapshot());
1224+
assumeTrue("INLINE STATS only available on snapshots", Build.current().isSnapshot());
12251225
indexTimestampData(1);
12261226

12271227
RequestObjectBuilder builder = requestObjectBuilder().query(
1228-
fromIndex() + " | EVAL now=NOW() | INLINESTATS AVG(value) BY now | SORT value ASC"
1228+
fromIndex() + " | EVAL now=NOW() | INLINE STATS AVG(value) BY now | SORT value ASC"
12291229
);
12301230
Map<String, Object> result = runEsql(builder);
12311231
ListMatcher values = matchesList();

x-pack/plugin/esql/qa/testFixtures/src/main/resources/fork.csv-spec

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -688,15 +688,16 @@ emp_no:integer | job_positions:keyword | _fork:keyword
688688
10087 | Junior Developer | fork2
689689
;
690690

691-
// INLINESTATS is under development, we enable this once it will be available
691+
// INLINE STATS is under development, we enable this once it will be available
692692
forkBeforeInlineStats-Ignore
693693
required_capability: fork_v9
694+
required_capability: inline_stats
694695

695696
FROM employees
696697
| KEEP emp_no, languages, gender
697698
| FORK (WHERE emp_no == 10048 OR emp_no == 10081)
698699
(WHERE emp_no == 10081 OR emp_no == 10087)
699-
| INLINESTATS max_lang = MAX(languages) BY gender
700+
| INLINE STATS max_lang = MAX(languages) BY gender
700701
| SORT emp_no, gender, _fork
701702
| LIMIT 5
702703
;
@@ -705,16 +706,17 @@ emp_no:integer | languages:integer | _fork:keyword | max_lang:integer | gender:k
705706
1 | 2 | 3 | 4 | 5
706707
;
707708

708-
// INLINESTATS is under development, we enable this once it will be available
709+
// INLINE STATS is under development, we enable this once it will be available
709710
forkBranchWithInlineStats-Ignore
710711
required_capability: fork_v9
712+
required_capability: inline_stats
711713

712714
FROM employees
713715
| KEEP emp_no, languages, gender
714716
| FORK (WHERE emp_no == 10048 OR emp_no == 10081
715-
| INLINESTATS x = MAX(languages) BY gender)
717+
| INLINE STATS x = MAX(languages) BY gender)
716718
(WHERE emp_no == 10081 OR emp_no == 10087
717-
| INLINESTATS x = MIN(languages))
719+
| INLINE STATS x = MIN(languages))
718720
(WHERE emp_no == 10012 OR emp_no == 10012)
719721
| SORT emp_no, gender, _fork
720722
;
@@ -727,13 +729,14 @@ emp_no:integer | languages:integer | x:integer | gender:keyword | _fork:keyword
727729
10087 | 5 | 2 | F | fork2
728730
;
729731

730-
// INLINESTATS is under development, we enable this once it will be available
732+
// INLINE STATS is under development, we enable this once it will be available
731733
forkAfterInlineStats-Ignore
732734
required_capability: fork_v9
735+
required_capability: inline_stats
733736

734737
FROM employees
735738
| KEEP emp_no, languages, gender
736-
| INLINESTATS max_lang = MAX(languages) BY gender
739+
| INLINE STATS max_lang = MAX(languages) BY gender
737740
| FORK (WHERE emp_no == 10048 OR emp_no == 10081)
738741
(WHERE emp_no == 10081 OR emp_no == 10087)
739742
| SORT emp_no, gender, _fork

0 commit comments

Comments
 (0)