Commit graph

231 commits

Author SHA1 Message Date
Bogdan Pintea
b65a3d00ff
SQL: Limit how much space some string functions can use (#107333) (#107632)
* SQL: Limit how much space some string functions can use (#107333)

This will check and fail if certain functions would generate a result
exceeding a certain fixed byte size.

This prevents an operation/query to fail the entire VM.

(cherry picked from commit f1bcb338ec)

* Fix use of forbidden APIs

* Style
2024-04-18 14:27:37 -04:00
Bogdan Pintea
d133702287
SQL: Update DbVisualizer connection steps (#85167) (#85559)
Update DbVisualizer connection steps to reflect version 13.0's integrated
Elasticsearch support.
2022-03-31 11:02:11 -04:00
James Rodewig
53ed187d63
[DOCS] Fix typos (#83895) (#83975)
Co-authored-by: Tobias Stadler <ts.stadler@gmx.de>
2022-02-15 13:05:01 -05:00
James Rodewig
da5fda0622
Add/update source block delimeters (#83624) (#83853)
Asciidoc source blocks are to be delimited with four dashes. This adds missing delimiters, and updates some that contained only three dashes. It matters for parsing purposes.

(cherry picked from commit 5ef77ef370)

Co-authored-by: edh-oss <42759970+edh-oss@users.noreply.github.com>
2022-02-11 15:44:20 -05:00
James Rodewig
89de0f1c12
[DOCS] Update multi-target syntax refs (#83703) (#83747)
(cherry picked from commit 6522e6eea2)

# Conflicts:
#	docs/reference/snapshot-restore/apis/create-snapshot-api.asciidoc
2022-02-09 13:44:37 -05:00
James Rodewig
e3fa0deaa2
[DOCS] SQL: Update client version compatability for 7.17 (#81869) (#82543)
Replaces a 7.x reference with the `{prev-major-last}` variable, which will use the last minor of the previous major (currently 7.17 for 8.x).

Relates to #70451.

(cherry picked from commit adca5b9dc5)
2022-01-13 08:56:17 -05:00
Bogdan Pintea
2e7e8ff2f0
SQL: Add CCS SQL documentation (#81545) (#82283)
This adds the documentation for CCS SQL.

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
(cherry picked from commit 13a0e420a3)
2022-01-05 16:23:53 -05:00
Bogdan Pintea
49833e3a28
SQL: Update documentation on Tableau integration (#60890) (#81163)
* Update docs on Tableau Desktop integration

Update the docs on how to integrate with Tableau Desktop, now using the
dedicated connector in conjunction with the JDBC driver.

* Add docs for connecting with Tableau Server

Add the steps required to connecto to Elasticsearch for Tableau Server.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
(cherry picked from commit fb6baa85aa)
2021-11-30 19:25:07 +01:00
James Rodewig
07ac8818b6
[DOCS] Remove testenv annotations from doc snippet tests (#80023) (#80458)
Removes `testenv` annotations and related code. These annotations originally let you skip x-pack snippet tests in the docs. However, that's no longer possible.

Relates to #79309, #31619
# Conflicts:
#	docs/reference/ml/df-analytics/apis/get-trained-model-deployment-stats.asciidoc
#	docs/reference/ml/df-analytics/apis/infer-trained-model-deployment.asciidoc
#	docs/reference/ml/df-analytics/apis/put-trained-model-definition-part.asciidoc
#	docs/reference/ml/df-analytics/apis/put-trained-model-vocabulary.asciidoc
#	docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc
#	docs/reference/ml/df-analytics/apis/stop-trained-model-deployment.asciidoc
#	docs/reference/slm/apis/slm-delete.asciidoc
#	docs/reference/slm/apis/slm-execute-retention.asciidoc
#	docs/reference/slm/apis/slm-execute.asciidoc
#	docs/reference/slm/apis/slm-get-status.asciidoc
#	docs/reference/slm/apis/slm-get.asciidoc
#	docs/reference/slm/apis/slm-start.asciidoc
#	docs/reference/slm/apis/slm-stats.asciidoc
#	docs/reference/slm/apis/slm-stop.asciidoc
#	docs/reference/sql/endpoints/client-apps/tableau-desktop.asciidoc
#	docs/reference/sql/endpoints/client-apps/tableau-server.asciidoc
2021-11-05 19:41:54 -04:00
James Rodewig
fb9192c42c
[DOCS] Remove [testenv="gold+"] attributes (#79309) (#79958)
Changes:

* Removes several `[testenv="gold+"]` attributes from the docs. `gold+` is not a valid [subscription level](https://www.elastic.co/subscriptions) or testenv value.
* Moves two `[testenv="basic"]` attributes to the file header. This makes the `testenv` placement consistent and fixes the yml file generated from `docs/reference/snapshot-restore/register-repository.asciidoc`.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: edh-oss <42759970+edh-oss@users.noreply.github.com>
2021-10-27 17:38:04 -04:00
Lukas Wegmann
9bf3a3203e
SQL: fix use of requestTimeout and pageTimeout query parameters (#79360) (#79915)
Resolves #72151 The _sql endpoint offers a `page_timeout` parameter for
customizing how long scroll contexts should be kept open (if needed) and
a `request_timeout` parameter which the docs describe as "Timeout before
the request fails.". Currently, the value of the `page_timeout`
parameter is used as the `timeout` in subsequent _search requests and
not as the timeout in the `scroll` configuration. For the `scroll`
configuration, SQL uses the `request_timeout` parameter. This PR
addresses the issue by swapping the uses of `page_timeout` and
`request_timeout` in querier. Additionally, the PR removes some unused
artifacts that might have caused some confusion: - The `timeout` and
`keepAlive` fields in `Querier`. Instead, `Querier` directly uses the
according fields in `SqlConfiguration`. - The `SqlConfiguration`
parameter from `ScrollCursor.clear`, it's not used but required an
instance of `SqlConfiguration` with all default values. - One overloaded
constructor of `SqlConfiguration` that was only used for calling
`ScrollCursor.clear` (and some tests) and used default values for an
(arbitrary?) subset of the fields. - The fields related to async
requests in `SqlConfiguration`. I'm a bit unsure about this one but the
fields are never read and it does not seem like an SQL specific concern.
The whole creation of the async tasks is handled in
`TransportSqlQueryAction` and the downstream components do not require
the information.
2021-10-27 10:25:11 -04:00
Lukas Wegmann
9ec09250c2
SQL: Adjust JDBC docs to use milliseconds for timeouts (#79628) (#79799)
Resolves #79480

My initial thought was to change the properties to be interpreted as seconds but this might not be worth it. All relevant places in the code seem to assume the timeouts to be in ms and there does not seem to be a consistent use of ms or s across JDBC drivers (Postgres uses seconds, MySQL uses ms, MS SQL mixes the two depending on the connection property).

Hence, just fixing the docs might be easier.
2021-10-26 07:55:40 -04:00
Andrei Stefan
e0c3f7756b
Mention scoring characteristics (#78965) (#78970) 2021-10-12 05:22:37 -04:00
Lukas Wegmann
371ac2e4a5
SQL: Fix disjunctions (and IN) with multiple date math expressions (#76424) (#77077)
* SQL: Fix disjunctions with multiple date math expressions

* review comments

* remove redundant FieldAttribute parameter

* address comments and add more specs

* fix typo
# Conflicts:
#	x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/planner/ExpressionTranslators.java
#	x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/planner/QueryTranslatorTests.java
2021-08-31 13:01:43 -04:00
James Rodewig
0ed92c845d
[DOCS] Update Kibana dev console screenshots for new EUI theme (#75626) (#75630)
Changes:

* Updates the Kibana dev console screenshots to use the new EUI theme
* Corrects an example SQL query in one screenshot. The previous screenshot used `_/sql`, which is not a valid URI.
2021-07-22 09:52:02 -04:00
James Rodewig
65a41afc6e [DOCS] Retitle 'SQL access' page to 'SQL' 2021-07-21 09:57:40 -04:00
James Rodewig
d02a481f1f
[DOCS] SQL: Add formal API docs (#75506) (#75579)
Adds formal API docs for the following APIs:

* Clear SQL cursor
* SQL search
* SQL translate

Other changes:

* Removes and redirects the "Supported REST parameters section." This is now covered in the SQL search API docs.
* Updates a few related xrefs.

Closes #75085
# Conflicts:
#	docs/reference/redirects.asciidoc
2021-07-21 09:16:40 -04:00
James Rodewig
a822aaa4ee Fix TOC order 2021-07-19 13:49:15 -04:00
James Rodewig
e99461ea38 [DOCS] Remove leading slashes 2021-07-19 13:43:04 -04:00
elasticsearchmachine
2bacc4bb59
[DOCS] Document async SQL APIs (#75078) (#75251)
Adds formal API docs and JSON specs for the following APIs:

* Get async SQL search
* Get async SQL search status
* Delete async SQL search

Closes #74845

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-07-12 11:20:14 -04:00
elasticsearchmachine
6dbbde5477
[DOCS] Mute snippet tests for #75069 (#75237) (#75241)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-07-12 10:00:39 -04:00
James Rodewig
fa3874b423
[DOCS] SQL: Document async SQL search (#74975) (#75038)
Documents async SQL search functionality.

I plan to add formal API documentation for the async APIs with a later PR.

Relates to #73991 and #74845.
2021-07-07 10:04:09 -04:00
James Rodewig
6ab041a543
[DOCS] SQL: Document null handling for functions (#74444) (#74495)
Closes #74193.
2021-06-23 11:22:40 -04:00
James Rodewig
ea0dd00162
[DOCS] SQL: Move null handling to arg descriptions (#74255) (#74261)
https://github.com/elastic/elasticsearch/pull/74201 documents `null` handling  to the arg descriptions of several string functions.

This PR moves pre-existing docs for `null` handling and similar edge case handling for string functions to arg descriptions for consistency.

Relates to #74193
2021-06-17 16:19:10 -04:00
James Rodewig
aa4108980c
[DOCS] SQL: Document null handing for string functions (#74201) (#74207) 2021-06-16 14:41:25 -04:00
James Rodewig
16d2142433 [DOCS] Change multi field to multi-field 2021-06-15 11:40:53 -04:00
Bogdan Pintea
33e510429a
SQL: Add ODBC proxy support documentation (#73263) (#73312)
This documents how to configure the proxy support for ODBC.
It also removes the documentation of the connection string values, these
are now all covered by the GUI settings.

Co-authored-by: Andrei Stefan <astefan@users.noreply.github.com>
(cherry picked from commit 522283c90e)
2021-05-24 10:29:48 +02:00
James Rodewig
f7f3f722d0
[DOCS] Remove and redirect frozen index overview content (#72990) (#73001)
Changes:

* Removes and adds redirects for the frozen indices [overview][0], [best
  practices][1], [search][2], and [monitoring][3] pages.
* Removes glossary terms related to frozen indices.
* Updates several xrefs to point to the freeze index API docs.

Relates to elastic/elasticsearch#72946 and elastic/elasticsearch#70192.

[0]: https://www.elastic.co/guide/en/elasticsearch/reference/7.12/frozen-indices.html
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/master/best_practices.html
[2]: https://www.elastic.co/guide/en/elasticsearch/reference/master/searching_a_frozen_index.html
[3]: https://www.elastic.co/guide/en/elasticsearch/reference/master/monitoring_frozen_indices.html
2021-05-12 13:05:20 -04:00
James Rodewig
c99822fe0b
[DOCS] EQL/SQL: Document runtime_mappings parameter (#71487) (#71837) 2021-04-19 09:30:00 -04:00
James Rodewig
c757f9e4e7
[DOCS] Fix double spaces (#71082) (#71120) 2021-03-31 11:43:34 -04:00
Adam Locke
c677bd0fc0
[DOCS] [7.x] Overhaul TLS security docs (#68946) (#70880)
* Removing security overview and condensing.

* Adding new security file.

* Minor changes.

* Removing link to pass build.

* Adding minimal security page.

* Adding minimal security page.

* Changes to intro.

* Add basic and basic + http configurations.

* Lots of changes, removed files, and redirects.

* Moving some AD and LDAP sections, plus more redirects.

* Redirects for SAML.

* Updating snippet languages and redirects.

* Adding another SAML redirect.

* Hopefully fixing the ci/2 error.

* Fixing another broken link for SAML.

* Adding what's next sections and some cleanup.

* Removes both security tutorials from the TOC.

* Adding redirect for removed tutorial.

* Add graphic for Elastic Security layers.

* Incorporating reviewer feedback.

* Update x-pack/docs/en/security/securing-communications/security-basic-setup.asciidoc

Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>

* Update x-pack/docs/en/security/securing-communications/security-minimal-setup.asciidoc

Co-authored-by: Yang Wang <ywangd@gmail.com>

* Update x-pack/docs/en/security/securing-communications/security-basic-setup.asciidoc

Co-authored-by: Yang Wang <ywangd@gmail.com>

* Update x-pack/docs/en/security/index.asciidoc

Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>

* Update x-pack/docs/en/security/securing-communications/security-basic-setup-https.asciidoc

Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>

* Apply suggestions from code review

Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>
Co-authored-by: Yang Wang <ywangd@gmail.com>

* Additional changes from review feedback.

* Incorporating reviewer feedback.

* Incorporating more reviewer feedback.

* Clarify that TLS is for authenticating nodes

Co-authored-by: Tim Vernum <tim@adjective.org>

* Clarify security between nodes

Co-authored-by: Tim Vernum <tim@adjective.org>

* Clarify that TLS is between nodes

Co-authored-by: Tim Vernum <tim@adjective.org>

* Update title for configuring Kibana with a password

Co-authored-by: Tim Vernum <tim@adjective.org>

* Move section for enabling passwords between Kibana and ES to minimal security.

* Add section for transport description, plus incorporate more reviewer feedback.

* Moving operator privileges lower in the navigation.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>
Co-authored-by: Yang Wang <ywangd@gmail.com>
Co-authored-by: Tim Vernum <tim@adjective.org>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Ioannis Kakavas <ikakavas@protonmail.com>
Co-authored-by: Yang Wang <ywangd@gmail.com>
Co-authored-by: Tim Vernum <tim@adjective.org>
2021-03-25 14:07:27 -04:00
Bogdan Pintea
e37a8f02e1
SQL: Enforce and document dedicated client version compatibility (#70451) (#70624)
* Implement dedicated client version compatibility

Add further dedicated client (xDBC, CLI) compatibility rules and
document these. A client is version-compatible with the server if:
- it supports version compatibility (past or on 7.7.0); and
- it's not on a version newer than server's; and
- it's major version is at most one unit behind server's.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
(cherry picked from commit 925f1645cf)
2021-03-22 12:56:19 +01:00
Andrei Stefan
e8b512d898
SQL: Adapt the limitations page to the new "fields" API usage (#69616) (#69814)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
(cherry picked from commit bf1b7a36b5)
2021-03-02 17:44:53 +02:00
Marios Trivyzas
ec42d7c24f
SQL: [Docs] Use the most common yyyy year pattern in examples (#69407)
To avoid confusion for the users replace the `YYYY` and `uuuu` year
patterns in the examples of `DATETIME_FORMAT/PARSE` with the most common
`yyyy` to avoid any confusion for users that might just copy paste those
queries for their own use case.

Relates to #68030

(cherry picked from commit c5cd7e51ef)
2021-02-23 14:48:26 +02:00
James Rodewig
7f7dc9dec3
[DOCS] Fix capitalization for Query DSL (#69236) (#69240) 2021-02-18 19:40:36 -05:00
James Rodewig
b55249507e
[DOCS] Fix typos for duplicate words (#69125) (#69132) 2021-02-17 11:16:58 -05:00
Marios Trivyzas
b5c46679bd
QL: Eliminate internal type DATETIME_NANOS (#68220) (#68850)
Moving towards grouping of data types in the field caps API
the internal data type `DATETIME_NANOS` introduced for `date_nanos`
support is eliminated.

Relates: #67722
Follows: #67666

(cherry picked from commit 45677a385b)
2021-02-10 22:01:14 +01:00
Andrei Stefan
50588fcb3a
QL: "fields" api implementation in QL (#68810)
* Integrate "fields" API into QL (#68467)
* QL: retry SQL and EQL requests in a mixed-node (rolling upgrade) cluster (#68602)
* Adapt nested fields extraction from "fields" API output to the new un-flattened structure (#68745)

(cherry picked from commit ee5cc5442a)
2021-02-10 14:57:35 +02:00
Andras Palinkas
4413897e7f
SQL: Test and fix the NULL handling of the String functions (#68379) (#68684)
Fixed the inconsistencies regarding NULL argument handling.
NULL literal vs NULL field value as function arguments in some case
resulted in different function return values.

Functions should return with the same value no matter if the argument(s)
came from a field or from a literal.

The introduced integration test tests if function calls with same
argument values (regardless of literal/field) will return with the
same output (also checks if newly added functions are added to the
testcases).

Fixed the following functions:
* Insert: NULL start, length and replacement arguments (as fields) also
result in NULL return value instead of returning the input.
* Locate: NULL pattern results in NULL return value, NULL optional start
argument handled the same as missing start argument
* Replace: NULL pattern and replacement results in NULL instead of
returning the input
* Substring: NULL start or length results in NULL instead of returning
the input

Fixes #58907

(cherry-pick from a3dbdae2ef)
2021-02-08 16:36:33 -05:00
James Rodewig
c6af9955d6
[DOCS] Fix typo (#68362) (#68381)
Co-authored-by: Jaskaran Bindra <jskrnbindra@gmail.com>
2021-02-02 09:45:40 -05:00
Marios Trivyzas
78c6d73a65
QL: Implement support for date_nanos ES type. (#67666) (#68198)
* QL: Implement support for date_nanos ES type. (#67666)

Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nanos precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: #38562

Co-authored-by: Bogdan Pintea <bogdan.pintea@elastic.co>

(cherry picked from commit bbf3cbfcfa)
2021-01-29 14:30:28 +01:00
Andras Palinkas
f9f3723e90
SQL: Implement TO_CHAR() function (#66486) (#67799)
* The implementation is according to PostgreSQL 13 specs:
https://www.postgresql.org/docs/13/functions-formatting.html
* Tested against actual output from PostgreSQL 13 using randomized inputs
* All the Postgres formats are supported, there is also partial supports
 for the modifiers (`FM` and `TH` are supported)
* Random unit test data generator script in case we need to upgrade the
 formatter in the future
* Documentation
* Integration tests

Co-authored-by: Michał Wąsowicz <mwasowicz7@gmail.com>
Co-authored-by: Andras Palinkas <andras.palinkas@elastic.co>
2021-01-21 15:40:21 -05:00
Bogdan Pintea
cc3a68730d Abort sorting in case of local agg sort queue overflow (#65687)
In case the local agg sorter queue gets full and no limit has been provided,
the local sorter will now erroneously call the failure callback for every
single row in the original rowset that's left over the local queue limit
(instead for just the first one).  The failure response is dispatched in any
case, so this is relatively harmless.  The sorter continues iterating on the
original response fetching subsequent pages. In case of correct Elasticsearch
behaviour, this is also harmless, it'll just trigger a number of internal
exceptions. However, in case of a pagination defect in Elasticsearch (like
GH#65685, where the same search_after is returned), this will result in an
effective spin loop, potentially rendering eventually the node unresponsive.

This PR simply breaks both the inner loop iterating over the current unsorted
rowset, as well as the outer one, iterating over the left pages.

It also fixes an outdated documentation limitation.

(cherry picked from commit 638402c387)
2020-12-07 11:32:07 +01:00
Andras Palinkas
4341e24c18
SQL: Add method args to PERCENTILE/PERCENTILE_RANK (#65026) (#65461)
* Adds the capability to have functions with two optional arguments
* Adds two new optional arguments to `PERCENTILE()` and
  `PERCENTILE_RANK()` functions, namely the method and
  method_parameter which can be: 1) `tdigest` and a double `compression`
  parameter or 2) `hdr` and an integer representing the
  `number_of_digits` parameter.
* Integration tests
* Documentation updates

Closes #63567
(cherry-picked from e90437e )
2020-11-25 09:46:44 -05:00
Bogdan Pintea
79446e204d SQL: Remove constant_keyword from SQL docs (#64709)
* Remove constant_keyword from SQL docs

`constant_keyword` removed as distinct type from SQL in #60524.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
(cherry picked from commit 6a92b3ec7c)
2020-11-06 20:10:21 +01:00
Andras Palinkas
3c9f183447 SQL: Escaped wildcard (*) not accepted in LIKE (#63428)
For a query like `SELECT name FROM test WHERE name LIKE ''%c*'` ES SQL
generates an error. `*` is not a special character in a `LIKE` construct
and it's expected to not needing to be escaped, so the previous query
should work as is.
In the LIKE pattern any `*` character was treated as invalid character
and the usage of `%` or `_` was suggested instead. But `*` is a valid,
acceptable non-wildcard on the right side of the `LIKE` operator.

Fix: #55108
(cherry picked from commit 190d9fe3de)
2020-10-13 10:26:06 -04:00
Marios Trivyzas
1f612cccbb
SQL: Implement FORMAT function (#55454) (#62701)
Implement FORMAT according to the SQL Server spec: https://docs.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql?view=sql-server-ver15#ExampleD by translating to the java.time patterns used in DATETIME_FORMAT.

Closes: #54965

Co-authored-by: Marios Trivyzas <matriv@users.noreply.github.com>
Co-authored-by: Bogdan Pintea <bogdan.pintea@elastic.co>
Co-authored-by: Andrei Stefan <astefan@users.noreply.github.com>
(cherry picked from commit da511f4e03)
2020-09-21 19:22:04 +02:00
Bogdan Pintea
5e0f9a414c SQL: Document Maven Central as a JDBC repository (#62618)
* Add Maven Central as a JDBC repository

Document Maven Central as a JDBC repository.

(cherry picked from commit 2bc4d7eb19)
2020-09-21 13:04:43 +02:00
James Rodewig
8613bde780
[DOCS] Combine keyword family docs (#61662) (#61813) 2020-09-01 15:32:56 -04:00
James Rodewig
60876a0e32
[DOCS] Replace Wikipedia links with attribute (#61171) (#61209) 2020-08-17 11:27:04 -04:00