-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Also added documentation and examples for BIT_LENGTH and LENGTH regarding unicode.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 116591 | ||
summary: "Add support for `BYTE_LENGTH` scalar function" | ||
area: ES|QL | ||
type: feature | ||
issues: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// the comments in whatever file the test already lives in. If you have to | ||
// write a new test to make an example in the docs then put it in whatever | ||
// file matches its "theme" best. Put it next to similar tests. Not here. | ||
|
||
// Also! When Nik originally extracted examples from the docs to make them | ||
// testable he didn't spend a lot of time putting the docs into appropriate | ||
// files. He just made this one. He didn't put his toys away. We'd be better | ||
|
@@ -352,26 +352,26 @@ FROM employees | |
|
||
// tag::case-result[] | ||
emp_no:integer | languages:integer| type:keyword | ||
10001 | 2 |bilingual | ||
10002 | 5 |polyglot | ||
10003 | 4 |polyglot | ||
10004 | 5 |polyglot | ||
10005 | 1 |monolingual | ||
10001 | 2 |bilingual | ||
10002 | 5 |polyglot | ||
10003 | 4 |polyglot | ||
10004 | 5 |polyglot | ||
10005 | 1 |monolingual | ||
// end::case-result[] | ||
; | ||
|
||
docsCountAll | ||
// tag::countAll[] | ||
FROM employees | ||
| STATS count = COUNT(*) BY languages | ||
FROM employees | ||
| STATS count = COUNT(*) BY languages | ||
| SORT languages DESC | ||
// end::countAll[] | ||
; | ||
|
||
// tag::countAll-result[] | ||
count:long | languages:integer | ||
10 |null | ||
21 |5 | ||
21 |5 | ||
18 |4 | ||
17 |3 | ||
19 |2 | ||
|
@@ -381,8 +381,8 @@ count:long | languages:integer | |
|
||
basicGrok | ||
// tag::basicGrok[] | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num}""" | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num}""" | ||
| KEEP date, ip, email, num | ||
// end::basicGrok[] | ||
; | ||
|
@@ -395,8 +395,8 @@ date:keyword | ip:keyword | email:keyword | num:keyword | |
|
||
grokWithConversionSuffix | ||
// tag::grokWithConversionSuffix[] | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}""" | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}""" | ||
| KEEP date, ip, email, num | ||
// end::grokWithConversionSuffix[] | ||
; | ||
|
@@ -409,8 +409,8 @@ date:keyword | ip:keyword | email:keyword | num:integer | |
|
||
grokWithToDatetime | ||
// tag::grokWithToDatetime[] | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}""" | ||
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42" | ||
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}""" | ||
| KEEP date, ip, email, num | ||
| EVAL date = TO_DATETIME(date) | ||
// end::grokWithToDatetime[] | ||
|
@@ -471,7 +471,7 @@ Tokyo | 100-7014 | null | |
|
||
basicDissect | ||
// tag::basicDissect[] | ||
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1" | ||
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1" | ||
| DISSECT a """%{date} - %{msg} - %{ip}""" | ||
| KEEP date, msg, ip | ||
// end::basicDissect[] | ||
|
@@ -485,8 +485,8 @@ date:keyword | msg:keyword | ip:keyword | |
|
||
dissectWithToDatetime | ||
// tag::dissectWithToDatetime[] | ||
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1" | ||
| DISSECT a """%{date} - %{msg} - %{ip}""" | ||
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1" | ||
| DISSECT a """%{date} - %{msg} - %{ip}""" | ||
| KEEP date, msg, ip | ||
| EVAL date = TO_DATETIME(date) | ||
// end::dissectWithToDatetime[] | ||
|
@@ -574,8 +574,8 @@ FROM employees | |
|
||
// tag::like-result[] | ||
first_name:keyword | last_name:keyword | ||
Ebbe |Callaway | ||
Eberhardt |Terkki | ||
Ebbe |Callaway | ||
Eberhardt |Terkki | ||
// end::like-result[] | ||
; | ||
|
||
|
@@ -589,7 +589,7 @@ FROM employees | |
|
||
// tag::rlike-result[] | ||
first_name:keyword | last_name:keyword | ||
Alejandro |McAlpine | ||
Alejandro |McAlpine | ||
// end::rlike-result[] | ||
; | ||
|
||
|
@@ -660,18 +660,19 @@ FROM sample_data | |
docsBitLength | ||
required_capability: fn_bit_length | ||
// tag::bitLength[] | ||
FROM employees | ||
| KEEP first_name, last_name | ||
| EVAL fn_bit_length = BIT_LENGTH(first_name) | ||
FROM airports | ||
| WHERE country == "India" | ||
| KEEP city | ||
| EVAL fn_length=LENGTH(city), fn_bit_length = BIT_LENGTH(city) | ||
// end::bitLength[] | ||
| SORT first_name | ||
| SORT city | ||
| LIMIT 3 | ||
; | ||
|
||
// tag::bitLength-result[] | ||
first_name:keyword | last_name:keyword | fn_bit_length:integer | ||
Alejandro |McAlpine |72 | ||
Amabile |Gomatam |56 | ||
Anneke |Preusig |48 | ||
city:keyword | fn_length:integer | fn_bit_length:integer | ||
Agwār | 5 | 48 | ||
Ahmedabad | 9 | 72 | ||
Bangalore | 9 | 72 | ||
// end::bitLength-result[] | ||
; |