Skip to content

Commit 57299ae

Browse files
committed
fix test to work around issue #120272
1 parent 713ba16 commit 57299ae

File tree

1 file changed

+12
-6
lines changed
  • x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql

1 file changed

+12
-6
lines changed

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/10_basic.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,20 +413,22 @@ FROM EVAL SORT LIMIT with documents_found:
413413
- match: {values.2: ["1",2.0,null,true,123,1674835275193]}
414414

415415
---
416-
"Test Unnamed Input Params Also For Limit":
416+
"Test Unnamed Input Params Also For Limit And Sample":
417417
- requires:
418418
test_runner_features: [ capabilities ]
419419
capabilities:
420420
- method: POST
421421
path: /_query
422422
parameters: [ ]
423-
capabilities: [ parameter_for_limit ]
423+
capabilities: [ parameter_for_limit, parameter_for_sample ]
424424
reason: "named or positional parameters"
425425
- do:
426426
esql.query:
427427
body:
428-
query: 'from test | eval x = ?, y = ?, z = ?, t = ?, u = ?, v = ? | keep x, y, z, t, u, v | limit ?'
429-
params: ["1", 2.0, null, true, 123, 1674835275193, 3]
428+
# The "| sort time" is to work around https://github.com/elastic/elasticsearch/issues/120272
429+
# TODO: remove it when the issue is fixed
430+
query: 'from test | sort time | sample ? | eval x = ?, y = ?, z = ?, t = ?, u = ?, v = ? | keep x, y, z, t, u, v | limit ?'
431+
params: [0.999999999999, "1", 2.0, null, true, 123, 1674835275193, 3]
430432

431433
- length: {columns: 6}
432434
- match: {columns.0.name: "x"}
@@ -461,7 +463,9 @@ FROM EVAL SORT LIMIT with documents_found:
461463
- do:
462464
esql.query:
463465
body:
464-
query: 'from test | sample ? | eval x = ?, y = ?, z = ?, t = ?, u = ?, v = ? | keep x, y, z, t, u, v | limit ?'
466+
# The "| sort time" is to work around https://github.com/elastic/elasticsearch/issues/120272
467+
# TODO: remove it when the issue is fixed
468+
query: 'from test | sort time | sample ? | eval x = ?, y = ?, z = ?, t = ?, u = ?, v = ? | keep x, y, z, t, u, v | limit ?'
465469
params: [{"s": 0.99999999999}, {"n1" : "1"}, {"n2" : 2.0}, {"n3" : null}, {"n4" : true}, {"n5" : 123}, {"n6": 1674835275193}, {"l": 3}]
466470

467471
- length: {columns: 6}
@@ -525,7 +529,9 @@ FROM EVAL SORT LIMIT with documents_found:
525529
- do:
526530
esql.query:
527531
body:
528-
query: 'from test | sample ?s | stats x = count(?f1), y = sum(?f2) by ?f3 | sort ?f3 | keep ?f3, x, y | limit ?l'
532+
# The "| sort time" is to work around https://github.com/elastic/elasticsearch/issues/120272
533+
# TODO: remove it when the issue is fixed
534+
query: 'from test | sort time | sample ?s | stats x = count(?f1), y = sum(?f2) by ?f3 | sort ?f3 | keep ?f3, x, y | limit ?l'
529535
params: [{"s": 0.99999999999}, {"f1" : {"identifier" : "time"}}, {"f2" : { "identifier" : "count" }}, {"f3" : { "identifier" : "color"}}, {"l": 3}]
530536

531537
- length: {columns: 3}

0 commit comments

Comments
 (0)