-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add ES|QL bit_length function #115792
Add ES|QL bit_length function #115792
Changes from 17 commits
6f59227
3de0143
7b69556
a5da6c4
7a2ecf9
cbcd332
2621b3c
ae82768
2583805
4626195
d6e1c66
a27f94a
7a94caa
0a4130c
666198e
db7931a
a0d2aee
b800d4f
db02eb7
3cdde43
f4c0abe
a9cfaf0
762be47
9c9511b
6dbadf2
b88922e
d868e08
989c770
b36fa7b
c708715
7f480bd
28ad3e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 115792 | ||
summary: Add ES|QL `bit_length` function | ||
area: ES|QL | ||
type: enhancement | ||
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -656,3 +656,21 @@ FROM sample_data | |
|
||
@timestamp:date | client_ip:ip | event_duration:long | message:keyword | ||
; | ||
|
||
docsBitLength | ||
// tag::bitLength[] | ||
FROM employees | ||
| KEEP first_name, last_name | ||
| EVAL fn_bit_length = BIT_LENGTH(first_name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As these are docs examples it's probably fine to let it solely be focused on |
||
// end::bitLength[] | ||
| SORT first_name | ||
| LIMIT 3 | ||
; | ||
|
||
// tag::bitLength-result[] | ||
first_name:keyword | last_name:keyword | fn_bit_length:integer | ||
Alejandro |McAlpine |72 | ||
Amabile |Gomatam |56 | ||
Anneke |Preusig |48 | ||
// end::bitLength-result[] | ||
; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,56 @@ emp_no:integer | l:integer | |
10003 | 5 | ||
; | ||
|
||
bitLength | ||
required_capability: fn_bit_length | ||
row a = "hello", b = "" | eval y = bit_length(a) + bit_length(b); | ||
|
||
a:keyword | b:keyword | y:integer | ||
hello | | 40 | ||
; | ||
|
||
bitLengthWithNonAsciiChars | ||
required_capability: fn_bit_length | ||
row a = "¡", b = "❗️" | eval y = bit_length(a) | eval z = bit_length(b); | ||
|
||
a:keyword | b:keyword | y:integer | z:integer | ||
¡ | ❗️ | 16 | 48 | ||
; | ||
|
||
foldBitLength | ||
required_capability: fn_bit_length | ||
row a = 1 | eval b = bit_length("hello"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could be |
||
|
||
a:integer | b:integer | ||
1 | 40 | ||
; | ||
|
||
bitLengthAndSourceQuoting | ||
required_capability: fn_bit_length | ||
from "employees" | sort emp_no | limit 3 | eval l = bit_length(first_name) | keep emp_no, l; | ||
|
||
emp_no:integer | l:integer | ||
10001 | 48 | ||
10002 | 56 | ||
10003 | 40 | ||
; | ||
|
||
bitLengthInsideOtherFunction | ||
required_capability: fn_bit_length | ||
row a = "abc", b = "de" | eval g = greatest(bit_length(a), bit_length(b), bit_length("fghi")); | ||
|
||
a:keyword | b:keyword | g:integer | ||
abc | de | 32 | ||
; | ||
|
||
bitLengthNull | ||
required_capability: fn_bit_length | ||
row a = "abc" | eval l = bit_length(null); | ||
|
||
a:string | l:integer | ||
abc | null | ||
; | ||
|
||
startsWithConstant | ||
from employees | sort emp_no | limit 10 | eval f_S = starts_with(first_name, "S") | keep emp_no, first_name, f_S; | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need
required_capability: fn_bit_length
.