Skip to content

Commit bed38d4

Browse files
committed
add capability
1 parent 893b0f8 commit bed38d4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// because the CSV tests don't support such assertions.
77

88
approximate stats on large data
9+
required_capability: approximate
910
approximate: true
1011

1112
FROM many_numbers
@@ -24,6 +25,7 @@ true
2425

2526

2627
exact stats on small data
28+
required_capability: approximate
2729
approximate: true
2830

2931
FROM many_numbers
@@ -37,6 +39,7 @@ count:long | avg:double | sum:long | min:integer | max:integer
3739

3840

3941
with where
42+
required_capability: approximate
4043
approximate: true
4144

4245
FROM many_numbers
@@ -56,6 +59,7 @@ true
5659

5760

5861
with sample
62+
required_capability: approximate
5963
approximate: true
6064

6165
FROM many_numbers
@@ -75,6 +79,7 @@ true
7579

7680

7781
with commands inbetween
82+
required_capability: approximate
7883
approximate: true
7984

8085
FROM many_numbers
@@ -101,6 +106,7 @@ true
101106

102107

103108
with commands after
109+
required_capability: approximate
104110
approximate: true
105111

106112
FROM many_numbers
@@ -123,6 +129,7 @@ true
123129

124130

125131
approximate stats by on large data
132+
required_capability: approximate
126133
approximate: true
127134

128135
FROM many_numbers
@@ -143,6 +150,7 @@ num:integer | is_expected:boolean
143150

144151

145152
exact stats by on small data
153+
required_capability: approximate
146154
approximate: true
147155

148156
FROM many_numbers

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,12 @@ public enum Cap {
13351335
/**
13361336
* Support correct counting of skipped shards.
13371337
*/
1338-
CORRECT_SKIPPED_SHARDS_COUNT;
1338+
CORRECT_SKIPPED_SHARDS_COUNT,
1339+
1340+
/**
1341+
* Support query approximation.
1342+
*/
1343+
APPROXIMATE;
13391344

13401345
private final boolean enabled;
13411346

0 commit comments

Comments
 (0)