Skip to content

Commit 12ccac0

Browse files
committed
Added csv tests and capability for sample and values on unsigned longs
1 parent df624be commit 12ccac0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,20 @@ sample_boolean:boolean | sample_datetime:datetime
6464
[false, true, true] | [1985-11-21T00:00:00.000Z, 1986-06-26T00:00:00.000Z, 1986-08-28T00:00:00.000Z] | [1.83, 2.03, 2.08] | [10001, 10002, 10003] | [Bezalel, Georgi, Parto] | [2, 4, 5]
6565
;
6666

67+
sample unsigned_long
68+
required_capability: agg_values_sample_unsigned_long
69+
70+
FROM ul_logs
71+
| STATS v = MV_SLICE(MV_SORT(SAMPLE(bytes_in, 99)), 3, 5)
72+
| MV_EXPAND v
73+
;
74+
75+
v:ul
76+
0
77+
74330435873664882
78+
154551962150890561
79+
;
80+
6781

6882
multivalued
6983
required_capability: agg_sample

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,14 @@ s:double | bytes_in:ul | bytes_out:ul
194194
1.0 | 1957665857956635540 | 352442273299370793
195195
1.0 | 2408213296071189837 | 419872666232023984
196196
;
197+
198+
values
199+
required_capability: agg_values_sample_unsigned_long
200+
from ul_logs | stats v = values(bytes_in) | MV_EXPAND v | SORT v | LIMIT 3;
201+
202+
v:ul
203+
0
204+
74330435873664882
205+
154551962150890561
206+
;
207+

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public enum Cap {
9797
*/
9898
AGG_MAX_MIN_UNSIGNED_LONG,
9999

100+
/**
101+
* Accept unsigned longs on VALUES and SAMPLE aggregations.
102+
*/
103+
AGG_VALUES_SAMPLE_UNSIGNED_LONG,
104+
100105
/**
101106
* Does ESQL support async queries.
102107
*/

0 commit comments

Comments
 (0)