Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Elasticsearch Query Language, ES|QL #98309

Merged
merged 1,354 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1354 commits
Select commit Hold shift + click to select a range
3a7746b
Make most singleton aggs null on empty (ESQL-1300)
nik9000 Jun 21, 2023
da1d54b
Merge pull request ESQL-1301 from elastic/main
elasticsearchmachine Jun 21, 2023
50a66f0
Merge pull request ESQL-1305 from elastic/main
elasticsearchmachine Jun 22, 2023
1a1cdcb
Emit warnings from bad `date_parse` (ESQL-1303)
nik9000 Jun 22, 2023
fa20e28
Introduce SurrogateExpression (ESQL-1285)
costin Jun 22, 2023
35fddc2
Create e() function (ESQL-1304)
nik9000 Jun 22, 2023
1659beb
Enable `min` and `max` aggs on dates (ESQL-1302)
nik9000 Jun 22, 2023
7b664ea
Merge pull request ESQL-1309 from elastic/main
elasticsearchmachine Jun 22, 2023
935e377
Merge pull request ESQL-1310 from elastic/main
elasticsearchmachine Jun 22, 2023
8badf8d
Support multi values in enrich lookup (ESQL-1298)
dnhatn Jun 22, 2023
edfeae2
Merge pull request ESQL-1312 from elastic/main
elasticsearchmachine Jun 23, 2023
79596cc
Add docs for ENRICH command (ESQL-1313)
luigidellaquila Jun 23, 2023
dad814f
Make Median a surrogate expression (ESQL-1307)
costin Jun 23, 2023
fe8a6c4
Add query parameters to ESQL (ESQL-1308)
luigidellaquila Jun 23, 2023
5e09373
Merge pull request ESQL-1314 from elastic/main
elasticsearchmachine Jun 23, 2023
15bb6f3
Merge pull request ESQL-1318 from elastic/main
elasticsearchmachine Jun 24, 2023
4030a5e
Merge pull request ESQL-1319 from elastic/main
elasticsearchmachine Jun 25, 2023
06ad8ec
Merge pull request ESQL-1320 from elastic/main
elasticsearchmachine Jun 26, 2023
908f0c3
Ensure grouping agg behavior on only null fields (ESQL-1311)
nik9000 Jun 26, 2023
f5c590b
[DOCS] Clarify the order for RENAME
abdonpijpelink Jun 26, 2023
73147db
Remove unnecessary space
abdonpijpelink Jun 26, 2023
a4c4f77
Merge pull request ESQL-1323 from elastic/main
elasticsearchmachine Jun 26, 2023
04f6b4e
Merge pull request ESQL-1325 from elastic/main
elasticsearchmachine Jun 26, 2023
33ad0e1
Pick changes upstream
costin Jun 27, 2023
c2c0b0f
Implement now() function (ESQL-1172)
luigidellaquila Jun 27, 2023
1a19419
Implement `MV_DEDUPE` (ESQL-1287)
nik9000 Jun 27, 2023
ce64080
Merge pull request ESQL-1322 from abdonpijpelink/rename-clarify-order
abdonpijpelink Jun 27, 2023
ceec5ab
Merge pull request ESQL-1330 from elastic/main
elasticsearchmachine Jun 27, 2023
dfb8188
Fix compilation
nik9000 Jun 27, 2023
8cb3cb8
Merge pull request ESQL-1332 from elastic/main
elasticsearchmachine Jun 28, 2023
7b9dbce
Remove ESQL IsNull in favor of QL (ESQL-1329)
costin Jun 28, 2023
a10223c
Merge pull request ESQL-1337 from elastic/main
elasticsearchmachine Jun 28, 2023
fa403c1
Lookup enrich queries in input order (ESQL-1324)
dnhatn Jun 29, 2023
c0fa87e
Merge pull request ESQL-1341 from elastic/main
elasticsearchmachine Jun 29, 2023
a23eb9e
Merge pull request ESQL-1343 from elastic/main
elasticsearchmachine Jun 30, 2023
4fad7e5
Towards multiple channel agg intermediate state (ESQL-1321)
ChrisHegarty Jun 30, 2023
6d80dee
Add metadata type and function support (ESQL-1315)
bpintea Jun 30, 2023
9cd98bf
Allow for randomisation in testSingleValueSparse (ESQL-1344)
ChrisHegarty Jun 30, 2023
15c7a11
Add Vector views over BigArray backed data (ESQL-1345)
ChrisHegarty Jun 30, 2023
731efd0
Merge pull request ESQL-1347 from elastic/main
elasticsearchmachine Jun 30, 2023
4696ed3
Merge pull request ESQL-1350 from elastic/main
elasticsearchmachine Jul 1, 2023
f76c371
Merge pull request ESQL-1351 from elastic/main
elasticsearchmachine Jul 2, 2023
8a01022
Merge pull request ESQL-1352 from elastic/main
elasticsearchmachine Jul 2, 2023
ead68fb
Support multivalued fields on arbitrary grouping (ESQL-1340)
nik9000 Jul 3, 2023
0b35376
Do not allow partial results in ESQL (ESQL-1349)
dnhatn Jul 3, 2023
3913509
Merge pull request ESQL-1355 from elastic/main
elasticsearchmachine Jul 3, 2023
882b4d8
Merge pull request ESQL-1362 from elastic/main
elasticsearchmachine Jul 3, 2023
ef53de0
Merge pull request ESQL-1363 from elastic/main
elasticsearchmachine Jul 3, 2023
b59f4e2
Merge pull request ESQL-1364 from elastic/main
elasticsearchmachine Jul 4, 2023
48cb069
Add unsigned_long type support (ESQL-1289)
bpintea Jul 4, 2023
ea5e26b
Merge pull request ESQL-1365 from elastic/main
elasticsearchmachine Jul 4, 2023
133f35b
Fix deprecated api usage in gradle build scripts
breskeby Jul 5, 2023
9b737ed
Merge pull request ESQL-1366 from elastic/fix-gradle-deprecations
breskeby Jul 5, 2023
fe14e17
Use TDigest fast mode in ESQL (ESQL-1361)
dnhatn Jul 5, 2023
f294be3
Merge pull request ESQL-1369 from elastic/main
elasticsearchmachine Jul 5, 2023
f3b2006
Add `PI` and `TAU` functions (ESQL-1357)
nik9000 Jul 5, 2023
c57e2d2
Merge pull request ESQL-1371 from elastic/main
elasticsearchmachine Jul 6, 2023
dbf569d
Merge pull request ESQL-1372 from elastic/main
elasticsearchmachine Jul 6, 2023
9ba3a12
Add support for text fields (ESQL-1354)
csoulios Jul 6, 2023
cbd4992
Clean `UnaryScalarFunction` slightly (ESQL-1359)
nik9000 Jul 6, 2023
3aeb7d5
Replace aggstate in aggs whose internal state is one of the primitive…
ChrisHegarty Jul 6, 2023
dde592c
Merge pull request ESQL-1386 from elastic/main
elasticsearchmachine Jul 6, 2023
985b194
Log base 10 for ESQL (ESQL-1358)
not-napoleon Jul 6, 2023
59c85fb
Add `last_updated` to status (ESQL-1387)
nik9000 Jul 6, 2023
dceb55c
Merge pull request ESQL-1392 from elastic/main
elasticsearchmachine Jul 7, 2023
1f1d57b
Pick breaking changes from upstream
costin Jul 7, 2023
f4581bb
Change ESQL into ES|QL
abdonpijpelink Jul 7, 2023
02d62d2
Remove meta tags
abdonpijpelink Jul 7, 2023
54a0a38
Move semicolons
abdonpijpelink Jul 7, 2023
68b74be
Move IS_NULL, POW, ROUND, STARTS_WITH, SUBSTRING code snippets to CSV…
abdonpijpelink Jul 7, 2023
188b0a7
Harden remote exchange flow (ESQL-1339)
dnhatn Jul 7, 2023
5e5edf8
Merge remote-tracking branch 'upstream/esql/lang' into es-pipe-ql
abdonpijpelink Jul 7, 2023
f636089
Fix another few usages of CURRENT
ChrisHegarty Jul 7, 2023
1ad09f3
Merge remote-tracking branch 'upstream/esql/lang' into es-pipe-ql
abdonpijpelink Jul 7, 2023
4ae275c
Minor changes to string template plugin to simplify upstream merging …
ChrisHegarty Jul 7, 2023
3c3963c
Add trim function
martijnvg Jul 7, 2023
4368795
made test a little bit more evil
martijnvg Jul 7, 2023
c406b64
use ROW in docs and added test with ROWS
martijnvg Jul 7, 2023
c58e262
Make the trim function efficient by performing trim on BytesRef inste…
martijnvg Jul 7, 2023
8f7ac51
Start to prevent massive grouping blocks (ESQL-1370)
nik9000 Jul 7, 2023
1f77e2b
Merge commit '6d45c57b8fc6d504fdc28f355c6db22ac811e629' into esql/lang
costin Jul 8, 2023
41595c1
Fix testRefreshSearchIdleShards (ESQL-1399)
dnhatn Jul 8, 2023
efc26ee
Fix count_distinct intermediate state (ESQL-1400)
dnhatn Jul 9, 2023
5b2178b
Merge pull request ESQL-1401 from elastic/main
elasticsearchmachine Jul 10, 2023
b259248
Reused example from spec file
martijnvg Jul 10, 2023
a9dac30
One more set of meta attributes
abdonpijpelink Jul 10, 2023
281a4bf
Change Trim#process to take one parameter that can be modified.
martijnvg Jul 10, 2023
34e9f7f
spotless
martijnvg Jul 10, 2023
a0c3504
Merge remote-tracking branch 'upstream/esql/lang' into es-pipe-ql
abdonpijpelink Jul 10, 2023
53df430
Revert "spotless"
martijnvg Jul 10, 2023
cd7c78e
Revert "Change Trim#process to take one parameter that can be modified."
martijnvg Jul 10, 2023
5fa9cc2
iter
martijnvg Jul 10, 2023
fb68688
Don't use provided scratch and always create a new BytesRef instance.
martijnvg Jul 10, 2023
467a2b7
Merge remote-tracking branch 'es/esql/lang' into string_trim
martijnvg Jul 10, 2023
e214daf
Add trim function
martijnvg Jul 10, 2023
46a2cab
Merge pull request ESQL-1407 from elastic/main
elasticsearchmachine Jul 10, 2023
5891f70
Update threadpool changes in ESQL
dnhatn Jul 10, 2023
a4d0f5c
Merge pull request ESQL-1408 from elastic/main
elasticsearchmachine Jul 11, 2023
d204de4
Merge pull request ESQL-1393 from abdonpijpelink/es-pipe-ql
abdonpijpelink Jul 11, 2023
9f845e4
Add status to `LIMIT` (ESQL-1388)
nik9000 Jul 11, 2023
5f754aa
Make page_size parameter configurable (ESQL-1402)
dnhatn Jul 11, 2023
d24bb80
Refactor and remove aggstate (ESQL-1410)
ChrisHegarty Jul 11, 2023
e8f4d5e
Merge pull request ESQL-1418 from elastic/main
elasticsearchmachine Jul 11, 2023
b3558f3
Add primitive variants in Log10 (ESQL-1409)
costin Jul 11, 2023
2c9a3d3
Batch remaining grouping impls (ESQL-1406)
nik9000 Jul 11, 2023
d5eeb59
Mute testExtractFields
dnhatn Jul 11, 2023
ea0e8af
Remove outdated asserts in TopNOperatorTests
dnhatn Jul 11, 2023
e9553df
Simplify state in Aggregator and Limit Operators (ESQL-1415)
dnhatn Jul 11, 2023
121ec84
Merge pull request ESQL-1421 from elastic/main
elasticsearchmachine Jul 12, 2023
b37cbd7
Remove Experimental from plan related types (ESQL-1417)
ChrisHegarty Jul 12, 2023
34aea7e
Remove Experimental from operators (ESQL-1416)
ChrisHegarty Jul 12, 2023
7c6811f
Remove Experimental from aggs (ESQL-1414)
ChrisHegarty Jul 12, 2023
d30cdb5
Remove last vestiges of Experimental (ESQL-1425)
ChrisHegarty Jul 12, 2023
334fb7d
Reset Lucene scorer if executing thread changed (ESQL-1422)
dnhatn Jul 12, 2023
f00a621
Merge pull request ESQL-1428 from elastic/main
elasticsearchmachine Jul 12, 2023
528b883
Merge pull request ESQL-1433 from elastic/main
elasticsearchmachine Jul 13, 2023
1bf3033
Pass the actual config when generating layout (ESQL-1427)
dnhatn Jul 13, 2023
98c0f29
Support multiple segments in enrich lookup (ESQL-1398)
dnhatn Jul 13, 2023
850139a
Merge pull request ESQL-1435 from elastic/main
elasticsearchmachine Jul 13, 2023
bf69adb
Adapt transport version change upstream
dnhatn Jul 13, 2023
b1a8a2d
Merge pull request ESQL-1436 from elastic/main
elasticsearchmachine Jul 13, 2023
a390621
Merge pull request ESQL-1437 from elastic/main
elasticsearchmachine Jul 14, 2023
701cd56
Use big array wrapped vectors in intermediate state of primitive aggs…
ChrisHegarty Jul 14, 2023
f247a14
Declare metadata fields part of the `from` command (ESQL-1432)
bpintea Jul 14, 2023
b8cf462
Remove/Revert new unused bits in BitArray (ESQL-1434)
ChrisHegarty Jul 14, 2023
3201f20
Merge pull request ESQL-1443 from elastic/main
elasticsearchmachine Jul 14, 2023
a44c5e2
Revert whitespace
ChrisHegarty Jul 14, 2023
406314f
Revert to align with upstream
ChrisHegarty Jul 14, 2023
9d3bdad
Disable javadocs for qa test projects (ESQL-1440)
ChrisHegarty Jul 15, 2023
a77f3fa
Merge pull request ESQL-1444 from elastic/main
elasticsearchmachine Jul 15, 2023
a9f0da3
Revert Use big array wrapped vectors in intermediate state of primiti…
ChrisHegarty Jul 17, 2023
8c1b161
Merge pull request ESQL-1449 from elastic/main
elasticsearchmachine Jul 17, 2023
ad9a3bd
Merge pull request ESQL-1452 from elastic/main
elasticsearchmachine Jul 18, 2023
0bb5b73
Wrapper around TextDocValuesField that provides access to the SortedB…
ChrisHegarty Jul 18, 2023
7694145
Fix needsInput of Limit operator (ESQL-1451)
dnhatn Jul 18, 2023
419db9d
Fix offset in grouping stats test (ESQL-1450)
dnhatn Jul 18, 2023
ba30f88
Revert now unnecessary change to AttributeSet (ESQL-1454)
ChrisHegarty Jul 18, 2023
7362abb
Merge pull request ESQL-1455 from elastic/main
elasticsearchmachine Jul 18, 2023
9aa0489
Increase driver iteration time limit (ESQL-1445)
dnhatn Jul 18, 2023
0e7eae2
Merge pull request ESQL-1456 from elastic/main
elasticsearchmachine Jul 19, 2023
95d9fd7
Add date_extract function (ESQL-1346)
luigidellaquila Jul 19, 2023
db206f8
Merge pull request ESQL-1461 from elastic/main
elasticsearchmachine Jul 20, 2023
6789cbe
Change pow() behaviour with unsigned long to return long
craigtaverner Jul 14, 2023
925bdf4
Improve documentation for pow function and refined type rules
craigtaverner Jul 14, 2023
75ea3ab
Numerical overflow should result in `null` and a warning
craigtaverner Jul 20, 2023
dd29c18
Merge pull request ESQL-1466 from elastic/main
elasticsearchmachine Jul 20, 2023
5cd790a
Merge pull request ESQL-1469 from elastic/main
elasticsearchmachine Jul 21, 2023
ddc3f0f
Fixed failing tests after change to types rules
craigtaverner Jul 21, 2023
9b3db59
Fix flaky test, warnings were not always present
craigtaverner Jul 21, 2023
9e566c9
Update docs/reference/esql/functions/pow.asciidoc
craigtaverner Jul 24, 2023
57f19d9
Code review cleanup
craigtaverner Jul 24, 2023
971004e
Cut the output of LuceneTopNSource into many pages (ESQL-1429)
nik9000 Jul 24, 2023
f24b47a
Merge pull request ESQL-1470 from elastic/main
elasticsearchmachine Jul 24, 2023
972ab7d
Allow filtering null on enrich fields (ESQL-1467)
dnhatn Jul 24, 2023
0db22ff
Merge pull request ESQL-1471 from elastic/main
elasticsearchmachine Jul 25, 2023
5aa1feb
Add `_query` endpoint as `_esql` replacement (ESQL-1463)
bpintea Jul 25, 2023
fa8b34c
Change `RENAME`'s syntax from using `=` to `AS` (ESQL-1462)
bpintea Jul 25, 2023
c0612f7
Fix `In` folding with BytesRef types (ESQL-1457)
bpintea Jul 25, 2023
161899e
Refactor function test cases (ESQL-1405)
not-napoleon Jul 25, 2023
204f09b
Fix flaky tests with warnings checks
craigtaverner Jul 25, 2023
659931a
Merge pull request ESQL-1475 from elastic/main
elasticsearchmachine Jul 25, 2023
87f3f07
Removed system.out calls
craigtaverner Jul 25, 2023
7bf3e20
Fix error in csv tests (ESQL-1474)
nik9000 Jul 25, 2023
cbb1050
Merge pull request ESQL-1480 from elastic/main
elasticsearchmachine Jul 26, 2023
f76bdaa
Support IN 3-valued logic (ESQL-1423)
bpintea Jul 26, 2023
ac710ba
Merge pull request ESQL-1439 from craigtaverner/esql/pow_unsigned_long
craigtaverner Jul 26, 2023
d8b88e1
Enable support for TEXT fields in GROK and DISSECT (ESQL-1482)
luigidellaquila Jul 26, 2023
4178416
Merge pull request ESQL-1485 from elastic/main
elasticsearchmachine Jul 26, 2023
dc3c7bd
Merge pull request ESQL-1487 from elastic/main
elasticsearchmachine Jul 27, 2023
923f86e
Merge pull request ESQL-1489 from elastic/main
elasticsearchmachine Jul 27, 2023
65af5b2
Size pages based on loaded columns (ESQL-1403)
nik9000 Jul 27, 2023
3cb4b16
Merge pull request ESQL-1490 from elastic/main
elasticsearchmachine Jul 28, 2023
cf7796c
Add support for Locale to ESQL (ESQL-1488)
luigidellaquila Jul 28, 2023
92bf9f1
Merge pull request ESQL-1492 from elastic/main
elasticsearchmachine Jul 28, 2023
0b5016a
Merge pull request ESQL-1500 from elastic/main
elasticsearchmachine Jul 29, 2023
6211f04
Merge pull request ESQL-1501 from elastic/main
elasticsearchmachine Jul 29, 2023
f5a175a
Merge pull request ESQL-1502 from elastic/main
elasticsearchmachine Jul 30, 2023
d40e478
Stop accidentally making tiny pages (ESQL-1506)
nik9000 Jul 31, 2023
bcefcd9
Merge pull request ESQL-1510 from elastic/main
elasticsearchmachine Jul 31, 2023
6c87075
Support `auto_bucket` for numeric fields (ESQL-1494)
nik9000 Jul 31, 2023
729f829
Merge pull request ESQL-1512 from elastic/main
elasticsearchmachine Aug 1, 2023
1e3f92b
Add support for multi-value input to DISSECT command (ESQL-1484)
luigidellaquila Aug 1, 2023
1b75dee
Change how grouping aggs track null (ESQL-1328)
nik9000 Aug 1, 2023
3c7c163
Exact math (ESQL-1507)
bpintea Aug 1, 2023
593849a
Merge pull request ESQL-1517 from elastic/main
elasticsearchmachine Aug 1, 2023
c44a245
Add trigonometric functions (ESQL-1513)
nik9000 Aug 1, 2023
7c30146
Add query to esql task (ESQL-1511)
nik9000 Aug 1, 2023
aca9284
Add support for `_id` fields (ESQL-1505)
csoulios Aug 1, 2023
2139472
Merge pull request ESQL-1522 from elastic/main
elasticsearchmachine Aug 2, 2023
f1d3c7c
Fix error loading sorted docs from empty (ESQL-1514)
nik9000 Aug 2, 2023
c1601f5
Add remaining trigonometric functions (ESQL-1518)
nik9000 Aug 2, 2023
5bc6ae2
Merge pull request ESQL-1525 from elastic/main
elasticsearchmachine Aug 2, 2023
cc0d8b0
Infer layout between plans instead of storing it (ESQL-1519)
costin Aug 2, 2023
24b2d16
Add `to_degrees` and `to_radians` functions (ESQL-1496)
nik9000 Aug 2, 2023
3537551
Pick upstream change
costin Aug 2, 2023
cacb595
Fix ESQL compilation
nik9000 Aug 2, 2023
04908b9
Merge pull request ESQL-1527 from elastic/main
elasticsearchmachine Aug 3, 2023
ab24925
Switch `mv_sum` to exact math (ESQL-1523)
bpintea Aug 3, 2023
8be61a3
Parameterized testing for ESQL functional tests (ESQL-1497)
not-napoleon Aug 3, 2023
6ff458b
Merge pull request ESQL-1530 from elastic/main
elasticsearchmachine Aug 3, 2023
85dd971
Merge pull request ESQL-1536 from elastic/main
elasticsearchmachine Aug 4, 2023
7f837af
Remove unused import from SQL build.gradle (ESQL-1537)
luigidellaquila Aug 4, 2023
0e29a89
Switch `mv_avg` to double summation for integral types (ESQL-1531)
bpintea Aug 4, 2023
f7d1e36
Optimize `In` when matching value is foldable (ESQL-1468)
bpintea Aug 4, 2023
4898d82
Fix Locale management in ESQL query request (ESQL-1538)
luigidellaquila Aug 4, 2023
5e0b839
Shrink "huge" combinatorial tests a little (ESQL-1476)
nik9000 Aug 4, 2023
b96ccc5
Group on `null`s in single fields (ESQL-1479)
nik9000 Aug 4, 2023
f22804a
Merge pull request ESQL-1542 from elastic/main
elasticsearchmachine Aug 4, 2023
c351235
Locally optimize missing fields (ESQL-1532)
costin Aug 4, 2023
1fdccf3
Merge pull request ESQL-1543 from elastic/main
elasticsearchmachine Aug 5, 2023
4b5fc5b
Merge pull request ESQL-1545 from elastic/main
elasticsearchmachine Aug 6, 2023
245d86e
Parameterized testing follow up (ESQL-1540)
not-napoleon Aug 7, 2023
9d1e4bc
Merge pull request ESQL-1546 from elastic/main
elasticsearchmachine Aug 7, 2023
ba9ad32
Merge pull request ESQL-1551 from elastic/main
elasticsearchmachine Aug 8, 2023
843eaca
Add tech preview admonition
abdonpijpelink Aug 8, 2023
47566f4
Update supported types list
abdonpijpelink Aug 8, 2023
0c14d5d
Update types list
abdonpijpelink Aug 8, 2023
3ccdab8
Merge pull request ESQL-1553 from elastic/main
elasticsearchmachine Aug 8, 2023
0dd92f1
Merge pull request ESQL-1552 from abdonpijpelink/docs-tech-preview-ad…
abdonpijpelink Aug 8, 2023
5255778
Blog examples (ESQL-1544)
costin Aug 9, 2023
1e53a53
Merge branch 'main' into feature/esql
ChrisHegarty Aug 10, 2023
c300712
Remove docs workaround (#98346)
ChrisHegarty Aug 10, 2023
51356a8
Test fix: add ESQL usage as a non-operator action (#98347)
ChrisHegarty Aug 10, 2023
c159ba6
ESQL: Add Multi-Value support to GROK operator (#98316)
luigidellaquila Aug 10, 2023
c131160
ESQL: Check the timespan value against the allowed range (#98319)
bpintea Aug 11, 2023
d07492d
Merge upstream
ChrisHegarty Aug 11, 2023
1f71456
ESQL: Add support for negative numbers in multivalues for ROW operato…
luigidellaquila Aug 11, 2023
6cd0578
ESQL: Pushdown metadata attributes (#98355)
bpintea Aug 12, 2023
bc74b6d
Verify the constant types assigned in a row (#98403)
bpintea Aug 12, 2023
7cb310b
Merge upstream
ChrisHegarty Aug 14, 2023
bb6ac04
Add unavailable EsqlFeatureSetUsage creation support (#98438)
ChrisHegarty Aug 14, 2023
2e4440f
Remove space in dissect feature list
ChrisHegarty Aug 14, 2023
8a4e423
Merge upstream
ChrisHegarty Aug 15, 2023
cb53b46
ESQL: Support `null` group key in more cases (#98507)
nik9000 Aug 15, 2023
f3bd0fb
ESQL: Optimize some `MV_` functions on sorted (#98515)
nik9000 Aug 15, 2023
1071740
Merge upstream
ChrisHegarty Aug 16, 2023
2f016e5
Update docs/changelog/98309.yaml
ChrisHegarty Aug 16, 2023
d03db64
Post-merge fix - update TransportResponseHandler.Empty::handleResponse
ChrisHegarty Aug 16, 2023
798ccf9
Merge upstream
ChrisHegarty Aug 16, 2023
2e9ea71
Fix changelog area
ChrisHegarty Aug 16, 2023
062cf0e
Post-merge fix - update TransportResponseHandler.Empty::handleRespons…
ChrisHegarty Aug 16, 2023
f462e60
Declare and assign TransportVersion for EsqlFeatureSetUsage (#98525)
ChrisHegarty Aug 16, 2023
0a5e0d3
Merge upstream
ChrisHegarty Aug 16, 2023
b498ce9
`Sqrt` function for ESQL (#98449)
kkrik-es Aug 16, 2023
109c2b6
Merge upstream
ChrisHegarty Aug 16, 2023
f93b9fd
ESQL: Enable expressions with arithmetic negation (#98352)
alex-spies Aug 16, 2023
d7c0f62
Merge upstream
ChrisHegarty Aug 16, 2023
014bd33
ESQL: replace the is_null function with IS NULL and IS NOT NULL predi…
astefan Aug 16, 2023
1cba73f
Prune unused columns from the query (#98462)
costin Aug 16, 2023
21dcb75
Merge upstream
ChrisHegarty Aug 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ testfixtures_shared/

# Generated
checkstyle_ide.xml
x-pack/plugin/esql/gen/
3 changes: 3 additions & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ dependencies {
exclude group: 'net.sf.jopt-simple', module: 'jopt-simple'
}
api(project(':modules:aggregations'))
api(project(':x-pack:plugin:ql'))
api(project(':x-pack:plugin:esql'))
api(project(':x-pack:plugin:esql:compute'))
expression(project(path: ':modules:lang-expression', configuration: 'zip'))
painless(project(path: ':modules:lang-painless', configuration: 'zip'))
api "org.openjdk.jmh:jmh-core:$versions.jmh"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.benchmark.compute.operator;

import org.elasticsearch.compute.data.BooleanBlock;
import org.elasticsearch.compute.data.BooleanVector;
import org.elasticsearch.compute.data.IntBlock;
import org.elasticsearch.compute.data.LongBlock;
import org.elasticsearch.compute.data.LongVector;
import org.elasticsearch.compute.data.Page;
import org.elasticsearch.compute.operator.EvalOperator;
import org.elasticsearch.compute.operator.Operator;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.xpack.esql.expression.function.scalar.date.DateTrunc;
import org.elasticsearch.xpack.esql.expression.function.scalar.math.Abs;
import org.elasticsearch.xpack.esql.planner.EvalMapper;
import org.elasticsearch.xpack.esql.planner.Layout;
import org.elasticsearch.xpack.esql.type.EsqlDataTypes;
import org.elasticsearch.xpack.ql.expression.FieldAttribute;
import org.elasticsearch.xpack.ql.expression.Literal;
import org.elasticsearch.xpack.ql.expression.predicate.operator.arithmetic.Add;
import org.elasticsearch.xpack.ql.expression.predicate.operator.comparison.Equals;
import org.elasticsearch.xpack.ql.tree.Source;
import org.elasticsearch.xpack.ql.type.DataTypes;
import org.elasticsearch.xpack.ql.type.EsField;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;

import java.time.Duration;
import java.util.Map;
import java.util.concurrent.TimeUnit;

@Warmup(iterations = 5)
@Measurement(iterations = 7)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@State(Scope.Thread)
@Fork(1)
public class EvalBenchmark {
private static final int BLOCK_LENGTH = 8 * 1024;

static {
// Smoke test all the expected values and force loading subclasses more like prod
try {
for (String operation : EvalBenchmark.class.getField("operation").getAnnotationsByType(Param.class)[0].value()) {
run(operation);
}
} catch (NoSuchFieldException e) {
throw new AssertionError();
}
}

@Param({ "abs", "add", "date_trunc", "equal_to_const", "long_equal_to_long", "long_equal_to_int" })
public String operation;

private static Operator operator(String operation) {
return new EvalOperator(evaluator(operation));
}

private static EvalOperator.ExpressionEvaluator evaluator(String operation) {
return switch (operation) {
case "abs" -> {
FieldAttribute longField = longField();
yield EvalMapper.toEvaluator(new Abs(Source.EMPTY, longField), layout(longField)).get();
}
case "add" -> {
FieldAttribute longField = longField();
yield EvalMapper.toEvaluator(
new Add(Source.EMPTY, longField, new Literal(Source.EMPTY, 1L, DataTypes.LONG)),
layout(longField)
).get();
}
case "date_trunc" -> {
FieldAttribute timestamp = new FieldAttribute(
Source.EMPTY,
"timestamp",
new EsField("timestamp", DataTypes.DATETIME, Map.of(), true)
);
yield EvalMapper.toEvaluator(
new DateTrunc(Source.EMPTY, timestamp, new Literal(Source.EMPTY, Duration.ofHours(24), EsqlDataTypes.TIME_DURATION)),
layout(timestamp)
).get();
}
case "equal_to_const" -> {
FieldAttribute longField = longField();
yield EvalMapper.toEvaluator(
new Equals(Source.EMPTY, longField, new Literal(Source.EMPTY, 100_000L, DataTypes.LONG)),
layout(longField)
).get();
}
case "long_equal_to_long" -> {
FieldAttribute lhs = longField();
FieldAttribute rhs = longField();
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get();
}
case "long_equal_to_int" -> {
FieldAttribute lhs = longField();
FieldAttribute rhs = intField();
yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get();
}
default -> throw new UnsupportedOperationException();
};
}

private static FieldAttribute longField() {
return new FieldAttribute(Source.EMPTY, "long", new EsField("long", DataTypes.LONG, Map.of(), true));
}

private static FieldAttribute intField() {
return new FieldAttribute(Source.EMPTY, "int", new EsField("int", DataTypes.INTEGER, Map.of(), true));
}

private static Layout layout(FieldAttribute... fields) {
Layout.Builder layout = new Layout.Builder();
for (FieldAttribute field : fields) {
layout.appendChannel(field.id());
}
return layout.build();
}

private static void checkExpected(String operation, Page actual) {
switch (operation) {
case "abs" -> {
LongVector v = actual.<LongBlock>getBlock(1).asVector();
for (int i = 0; i < BLOCK_LENGTH; i++) {
if (v.getLong(i) != i * 100_000) {
throw new AssertionError("[" + operation + "] expected [" + (i * 100_000) + "] but was [" + v.getLong(i) + "]");
}
}
}
case "add" -> {
LongVector v = actual.<LongBlock>getBlock(1).asVector();
for (int i = 0; i < BLOCK_LENGTH; i++) {
if (v.getLong(i) != i * 100_000 + 1) {
throw new AssertionError("[" + operation + "] expected [" + (i * 100_000 + 1) + "] but was [" + v.getLong(i) + "]");
}
}
}
case "date_trunc" -> {
LongVector v = actual.<LongBlock>getBlock(1).asVector();
long oneDay = TimeValue.timeValueHours(24).millis();
for (int i = 0; i < BLOCK_LENGTH; i++) {
long expected = i * 100_000;
expected -= expected % oneDay;
if (v.getLong(i) != expected) {
throw new AssertionError("[" + operation + "] expected [" + expected + "] but was [" + v.getLong(i) + "]");
}
}
}
case "equal_to_const" -> {
BooleanVector v = actual.<BooleanBlock>getBlock(1).asVector();
for (int i = 0; i < BLOCK_LENGTH; i++) {
if (v.getBoolean(i) != (i == 1)) {
throw new AssertionError("[" + operation + "] expected [" + (i == 1) + "] but was [" + v.getBoolean(i) + "]");
}
}
}
case "long_equal_to_long", "long_equal_to_int" -> {
BooleanVector v = actual.<BooleanBlock>getBlock(2).asVector();
for (int i = 0; i < BLOCK_LENGTH; i++) {
if (v.getBoolean(i) != true) {
throw new AssertionError("[" + operation + "] expected [" + (i == 1) + "] but was [" + v.getBoolean(i) + "]");
}
}
}
default -> throw new UnsupportedOperationException();
}
}

private static Page page(String operation) {
return switch (operation) {
case "abs", "add", "date_trunc", "equal_to_const" -> {
var builder = LongBlock.newBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
builder.appendLong(i * 100_000);
}
yield new Page(builder.build());
}
case "long_equal_to_long" -> {
var lhs = LongBlock.newBlockBuilder(BLOCK_LENGTH);
var rhs = LongBlock.newBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
lhs.appendLong(i * 100_000);
rhs.appendLong(i * 100_000);
}
yield new Page(lhs.build(), rhs.build());
}
case "long_equal_to_int" -> {
var lhs = LongBlock.newBlockBuilder(BLOCK_LENGTH);
var rhs = IntBlock.newBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
lhs.appendLong(i * 100_000);
rhs.appendInt(i * 100_000);
}
yield new Page(lhs.build(), rhs.build());
}
default -> throw new UnsupportedOperationException();
};
}

@Benchmark
@OperationsPerInvocation(1024 * BLOCK_LENGTH)
public void run() {
run(operation);
}

private static void run(String operation) {
try (Operator operator = operator(operation)) {
Page page = page(operation);
Page output = null;
for (int i = 0; i < 1024; i++) {
operator.addInput(page);
output = operator.getOutput();
}
// We only check the last one
checkExpected(operation, output);
}
}
}
Loading