Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
613f58c
Function test
pfcoperez Oct 26, 2025
492120a
Add `ascii` to the function registry
pfcoperez Oct 27, 2025
5365172
`ascii` function implementation
pfcoperez Oct 27, 2025
4e04a53
Simplified test case
pfcoperez Oct 27, 2025
2904ddd
Clean-up code imports and add comments.
pfcoperez Oct 28, 2025
df9825d
Expand the string.csv-spec case
pfcoperez Oct 28, 2025
085034e
Simplify and clean-up code
pfcoperez Oct 28, 2025
47e613a
Improve comments
pfcoperez Oct 28, 2025
fc7fa49
First UT version
pfcoperez Oct 28, 2025
e64a5e2
Add function to `ScalarFunctionWritables`
pfcoperez Oct 28, 2025
f07888d
Override function data type
pfcoperez Oct 28, 2025
4065f60
Fix UTs
pfcoperez Oct 28, 2025
8463971
Fix format
pfcoperez Oct 28, 2025
be20392
Docs updates
pfcoperez Oct 28, 2025
baf9dc3
Adds ES version from which the function will be supported.
pfcoperez Oct 28, 2025
7bd2ade
Add `required_capacity` to ASCII CsvTests
pfcoperez Oct 28, 2025
92b4734
Fix `appliesTo` annotation
pfcoperez Oct 28, 2025
c02b945
Add ASCII to capabilities list
pfcoperez Oct 28, 2025
46a5dd2
Docs: Reference string in functions listings
pfcoperez Oct 28, 2025
f9308aa
Fix docs broken reference
pfcoperez Oct 28, 2025
400aad1
Replace String.format with ES commons Strings.format
pfcoperez Oct 28, 2025
b420a7d
Updates on docs generated files
pfcoperez Oct 28, 2025
6f89c53
Update docs with example
pfcoperez Oct 29, 2025
a6b4096
Remove the first size computation path optimization
pfcoperez Oct 29, 2025
e25b899
Optimize implementation, removing optional return values
pfcoperez Oct 29, 2025
b6d4a4a
Expand test cases
pfcoperez Oct 29, 2025
2abde3f
Add test cases for '\"'
pfcoperez Oct 29, 2025
10495f2
Move reusable codepoint to be a fix static value in the evaluator.
pfcoperez Oct 29, 2025
f755162
Rename function to `TO_ASCII`
pfcoperez Oct 30, 2025
be5beef
Use `@ConvertEvaluator` instead of `@Evaluator` to allow processing m…
pfcoperez Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
@@ -1,3 +1,4 @@
* [`TO_ASCII`](../../functions-operators/string-functions.md#esql-to_ascii)
* [`BIT_LENGTH`](../../functions-operators/string-functions.md#esql-bit_length)
* [`BYTE_LENGTH`](../../functions-operators/string-functions.md#esql-byte_length)
* [`CONCAT`](../../functions-operators/string-functions.md#esql-concat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ mapped_pages:
:::{include} ../_snippets/lists/string-functions.md
:::

:::{include} ../_snippets/functions/layout/to_ascii.md
:::

:::{include} ../_snippets/functions/layout/bit_length.md
:::
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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
Expand Up @@ -2748,3 +2748,14 @@ book_no:keyword | author_encoded:keyword | title_encoded:keyword
1463 | J.%20R.%20R.%20Tolkien | Realms%20of%20Tolkien%3A%20Images%20of%20Middle-earth
;

to_ascii
required_capability: to_ascii
// tag::to_ascii[]
ROW a = "Hello\n\t 世界! 🌍 Café naïve résumé こんにちは 🎉 中文测试 αβγδε 日本語テスト 🚀🔥💧🪨" | EVAL x = TO_ASCII(a) | KEEP x;
// end::to_ascii[]

// tag::to_ascii-result[]
x:keyword
Hello\\n\\t \\u4e16\\u754c! \\U0001f30d Caf\\xe9 na\\xefve r\\xe9sum\\xe9 \\u3053\\u3093\\u306b\\u3061\\u306f \\U0001f389 \\u4e2d\\u6587\\u6d4b\\u8bd5 \\u03b1\\u03b2\\u03b3\\u03b4\\u03b5 \\u65e5\\u672c\\u8a9e\\u30c6\\u30b9\\u30c8 \\U0001f680\\U0001f525\\U0001f4a7\\U0001faa8
// end::to_ascii-result[]
;

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
Expand Up @@ -1529,7 +1529,12 @@ public enum Cap {
/**
* Fix double release in inline stats when LocalRelation is reused
*/
INLINE_STATS_DOUBLE_RELEASE_FIX(INLINESTATS_V11.enabled)
INLINE_STATS_DOUBLE_RELEASE_FIX(INLINESTATS_V11.enabled),

/**
* Support for string function TO_ASCII
*/
TO_ASCII

;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
import org.elasticsearch.xpack.esql.expression.function.scalar.string.Split;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.StartsWith;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.Substring;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToAscii;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToLower;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToUpper;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.Trim;
Expand Down Expand Up @@ -397,6 +398,7 @@ private static FunctionDefinition[][] functions() {
def(Tau.class, Tau::new, "tau") },
// string
new FunctionDefinition[] {
def(ToAscii.class, ToAscii::new, "to_ascii"),
def(BitLength.class, BitLength::new, "bit_length"),
def(ByteLength.class, ByteLength::new, "byte_length"),
def(Concat.class, Concat::new, "concat"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.elasticsearch.xpack.esql.expression.function.scalar.string.Split;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.StartsWith;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.Substring;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToAscii;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToLower;
import org.elasticsearch.xpack.esql.expression.function.scalar.string.ToUpper;
import org.elasticsearch.xpack.esql.expression.predicate.logical.And;
Expand All @@ -67,6 +68,7 @@ public class ScalarFunctionWritables {
public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
entries.add(And.ENTRY);
entries.add(ToAscii.ENTRY);
entries.add(Atan2.ENTRY);
entries.add(BitLength.ENTRY);
entries.add(Case.ENTRY);
Expand Down
Loading
Loading