You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For cases where fields can have multi values, allow the behavior to be
customized through a dedicated configuration field.
By default this will be enabled on the drivers so that existing datasets
work instead of throwing an exception.
For regular SQL usage, the behavior is false so that the user is aware
of the underlying data.
Fix#39700
Copy file name to clipboardExpand all lines: docs/reference/sql/endpoints/jdbc.asciidoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,10 @@ Query timeout (in seconds). That is the maximum amount of time waiting for a que
122
122
123
123
`proxy.socks`:: SOCKS proxy host name
124
124
125
+
[float]
126
+
==== Mapping
127
+
`field.multi.value.leniency` (default `true`):: Whether to be lenient and return the first value for fields with multiple values (true) or throw an exception.
Copy file name to clipboardExpand all lines: docs/reference/sql/endpoints/rest.asciidoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -356,6 +356,10 @@ More information available https://docs.oracle.com/javase/8/docs/api/java/time/Z
356
356
|false
357
357
|Return the results in a columnar fashion, rather than row-based fashion. Valid for `json`, `yaml`, `cbor` and `smile`.
358
358
359
+
|field_multi_value_leniency
360
+
|false
361
+
|Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order).
362
+
359
363
|===
360
364
361
365
Do note that most parameters (outside the timeout and `columnar` ones) make sense only during the initial query - any follow-up pagination request only requires the `cursor` parameter as explained in the <<sql-pagination, pagination>> chapter.
Copy file name to clipboardExpand all lines: docs/reference/sql/limitations.asciidoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ pagination taking place on the **root nested document and not on its inner hits*
60
60
61
61
Array fields are not supported due to the "invisible" way in which {es} handles an array of values: the mapping doesn't indicate whether
62
62
a field is an array (has multiple values) or not, so without reading all the data, {es-sql} cannot know whether a field is a single or multi value.
63
+
When multiple values are returned for a field, by default, {es-sql} will throw an exception. However, it is possible to change this behavior through `field_multi_value_leniency` parameter in REST (disabled by default) or
64
+
`field.multi.value.leniency` in drivers (enabled by default).
Copy file name to clipboardExpand all lines: x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ public AbstractSqlQueryRequest() {
0 commit comments