summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimunkin <[email protected]>2025-06-17 18:27:30 +0300
committerimunkin <[email protected]>2025-06-17 18:45:29 +0300
commitb4cd48c623225c9cc0bbcb970b035812c7774e17 (patch)
tree14dfe9abdbb018e7252a6bc77a65016da5e72b1b
parentfaf5ed9056a6e5fd9b8c932b803d5f2dd776fee0 (diff)
Update minimal langver for Ascii{Starts,Ends}WithIgnoreCase functions in String UDF
Follows up 4b86982498876ec14632c0a018a940c3393bb5d6 commit_hash:17be35db9650e9e8e63ae88f2bce18d77c8d6938
-rw-r--r--yql/essentials/docs/en/udf/list/string.md4
-rw-r--r--yql/essentials/docs/ru/udf/list/string.md4
-rw-r--r--yql/essentials/udfs/common/string/string_udf.cpp12
-rw-r--r--yql/essentials/udfs/common/string/test/canondata/result.json5
-rw-r--r--yql/essentials/udfs/common/string/test/canondata/test.test_AsciiCmpIgnoreCase_AllAlternatives_2025_01_/results.txt121
-rw-r--r--yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_/extracted20
-rw-r--r--yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_scan_/extracted20
-rw-r--r--yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.cfg2
-rw-r--r--yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.sql10
-rw-r--r--yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01.sql2
-rw-r--r--yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01_scan.sql2
11 files changed, 150 insertions, 52 deletions
diff --git a/yql/essentials/docs/en/udf/list/string.md b/yql/essentials/docs/en/udf/list/string.md
index 6b8e000c765..3d77857b2e0 100644
--- a/yql/essentials/docs/en/udf/list/string.md
+++ b/yql/essentials/docs/en/udf/list/string.md
@@ -42,7 +42,7 @@ Functions for ASCII strings:
* `String::ReverseFind(String{Flags:AutoMap}, String, [Uint64?]) -> Int64`: Returns the last position found or -1. The optional argument is the offset from the beginning of the string.
-* `String::AsciiStartsWithIgnoreCase(String?, String) -> Bool` Added in the version [2025.02](../../changelog/2025.02.md#string-module)
+* `String::AsciiStartsWithIgnoreCase(String?, String) -> Bool`
* `String::HasPrefix(String?, String) -> Bool`
@@ -52,7 +52,7 @@ Functions for ASCII strings:
* `String::StartsWithIgnoreCase(String?, String) -> Bool` Removed in the version [2025.02](../../changelog/2025.02.md#string-module)
-* `String::AsciiEndsWithIgnoreCase(String?, String) -> Bool` Added in the version [2025.02](../../changelog/2025.02.md#string-module)
+* `String::AsciiEndsWithIgnoreCase(String?, String) -> Bool`
* `String::HasSuffix(String?, String) -> Bool`
diff --git a/yql/essentials/docs/ru/udf/list/string.md b/yql/essentials/docs/ru/udf/list/string.md
index c2bf6ec544c..baaf7ef84f1 100644
--- a/yql/essentials/docs/ru/udf/list/string.md
+++ b/yql/essentials/docs/ru/udf/list/string.md
@@ -62,8 +62,8 @@ SELECT String::Strip("YQL "); -- "YQL"
Устаревшие функции, к использованию не рекомендуются.
-* `String::AsciiStartsWithIgnoreCase(string:String?, prefix:String) -> Bool` - добавлена в версии [2025.02](../../changelog/2025.02.md#string-module)
-* `String::AsciiEndsWithIgnoreCase(string:String?, suffix:String) -> Bool` - добавлена в версии [2025.02](../../changelog/2025.02.md#string-module)
+* `String::AsciiStartsWithIgnoreCase(string:String?, prefix:String) -> Bool`
+* `String::AsciiEndsWithIgnoreCase(string:String?, suffix:String) -> Bool`
* `String::HasPrefixIgnoreCase(string:String?, prefix:String) -> Bool` - удалена в версии [2025.02](../../changelog/2025.02.md#string-module)
* `String::StartsWithIgnoreCase(string:String?, prefix:String) -> Bool` - удалена в версии [2025.02](../../changelog/2025.02.md#string-module)
* `String::HasSuffixIgnoreCase(string:String?, suffix:String) -> Bool` - удалена в версии [2025.02](../../changelog/2025.02.md#string-module)
diff --git a/yql/essentials/udfs/common/string/string_udf.cpp b/yql/essentials/udfs/common/string/string_udf.cpp
index 5c24485129d..f42fcfd2479 100644
--- a/yql/essentials/udfs/common/string/string_udf.cpp
+++ b/yql/essentials/udfs/common/string/string_udf.cpp
@@ -185,7 +185,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>),
} \
}
-#define STRING_ASCII_CMP_IGNORE_CASE_UDF(udfName, function) \
+#define STRING_ASCII_CMP_IGNORE_CASE_UDF(udfName, function, minVersion) \
TUnboxedValuePod udfName##Impl(const TUnboxedValuePod* args) { \
if (args[0]) { \
const TString haystack(args[0].AsStringRef()); \
@@ -215,7 +215,7 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>),
\
BEGIN_SIMPLE_STRICT_ARROW_UDF_OPTIONS(T##udfName, \
bool(TOptional<char*>, char*), \
- builder.SetMinLangVer(NYql::MakeLangVersion(2025, 2))) \
+ builder.SetMinLangVer(minVersion)) \
{ \
Y_UNUSED(valueBuilder); \
return udfName##Impl(args); \
@@ -439,10 +439,10 @@ SIMPLE_STRICT_UDF_OPTIONS(TReverse, TOptional<char*>(TOptional<char*>),
XX(HasPrefixIgnoreCase, AsciiHasPrefixIgnoreCase) \
XX(HasSuffixIgnoreCase, AsciiHasSuffixIgnoreCase)
-#define STRING_ASCII_CMP_IGNORE_CASE_UDF_MAP(XX) \
- XX(AsciiStartsWithIgnoreCase, AsciiHasPrefixIgnoreCase) \
- XX(AsciiEndsWithIgnoreCase, AsciiHasSuffixIgnoreCase) \
- XX(AsciiEqualsIgnoreCase, AsciiEqualsIgnoreCase)
+#define STRING_ASCII_CMP_IGNORE_CASE_UDF_MAP(XX) \
+ XX(AsciiStartsWithIgnoreCase, AsciiHasPrefixIgnoreCase, NYql::MakeLangVersion(2025, 1)) \
+ XX(AsciiEndsWithIgnoreCase, AsciiHasSuffixIgnoreCase, NYql::MakeLangVersion(2025, 1)) \
+ XX(AsciiEqualsIgnoreCase, AsciiEqualsIgnoreCase, NYql::MakeLangVersion(2025, 2))
// NOTE: The functions below are marked as deprecated, so block implementation
// is not required for them. Hence, STROKA_UDF provides only the scalar one at
diff --git a/yql/essentials/udfs/common/string/test/canondata/result.json b/yql/essentials/udfs/common/string/test/canondata/result.json
index 0feffac589c..a99f95f7db6 100644
--- a/yql/essentials/udfs/common/string/test/canondata/result.json
+++ b/yql/essentials/udfs/common/string/test/canondata/result.json
@@ -14,6 +14,11 @@
"uri": "file://test.test_AsciiCmpIgnoreCase_2025_02_/extracted"
}
],
+ "test.test[AsciiCmpIgnoreCase_AllAlternatives_2025_01]": [
+ {
+ "uri": "file://test.test_AsciiCmpIgnoreCase_AllAlternatives_2025_01_/results.txt"
+ }
+ ],
"test.test[AsciiContainsIgnoreCase_2025_01]": [
{
"uri": "file://test.test_AsciiContainsIgnoreCase_2025_01_/extracted"
diff --git a/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiCmpIgnoreCase_AllAlternatives_2025_01_/results.txt b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiCmpIgnoreCase_AllAlternatives_2025_01_/results.txt
new file mode 100644
index 00000000000..b467eae86b1
--- /dev/null
+++ b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiCmpIgnoreCase_AllAlternatives_2025_01_/results.txt
@@ -0,0 +1,121 @@
+[
+ {
+ "Write" = [
+ {
+ "Type" = [
+ "ListType";
+ [
+ "StructType";
+ [
+ [
+ "value";
+ [
+ "DataType";
+ "String"
+ ]
+ ];
+ [
+ "icprefix";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ];
+ [
+ "icstarts";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ];
+ [
+ "aicstarts";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ];
+ [
+ "icsuffix";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ];
+ [
+ "icends";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ];
+ [
+ "aicends";
+ [
+ "DataType";
+ "Bool"
+ ]
+ ]
+ ]
+ ]
+ ];
+ "Data" = [
+ [
+ "fdsa";
+ %false;
+ %false;
+ %false;
+ %false;
+ %false;
+ %false
+ ];
+ [
+ "aswedfg";
+ %true;
+ %true;
+ %true;
+ %false;
+ %false;
+ %false
+ ];
+ [
+ "asdadsaasd";
+ %true;
+ %true;
+ %true;
+ %false;
+ %false;
+ %false
+ ];
+ [
+ "gdsfsassas";
+ %false;
+ %false;
+ %false;
+ %true;
+ %true;
+ %true
+ ];
+ [
+ "";
+ %false;
+ %false;
+ %false;
+ %false;
+ %false;
+ %false
+ ];
+ [
+ "`\xD0\x9F\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82, \xD0\xBC\xD0\xB8\xD1\x80!`";
+ %false;
+ %false;
+ %false;
+ %false;
+ %false;
+ %false
+ ]
+ ]
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_/extracted b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_/extracted
index 6c66d69cd7f..e663ef8331c 100644
--- a/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_/extracted
+++ b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_/extracted
@@ -25,26 +25,8 @@
SELECT
^
<tmp_path>/program.sql:<main>:10:13: Error: At function: Apply, At function: Udf
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- ^
- <tmp_path>/program.sql:<main>:10:13: Error: UDF 'String.AsciiStartsWithIgnoreCase' is not available before version 2025.02
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- ^
- <tmp_path>/program.sql:<main>:2:1: Error: At function: SqlProjectItem, At lambda
- SELECT
- ^
- <tmp_path>/program.sql:<main>:12:13: Error: At function: Apply, At function: Udf
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
- ^
- <tmp_path>/program.sql:<main>:12:13: Error: UDF 'String.AsciiEndsWithIgnoreCase' is not available before version 2025.02
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
- ^
- <tmp_path>/program.sql:<main>:2:1: Error: At function: SqlProjectItem, At lambda
- SELECT
- ^
- <tmp_path>/program.sql:<main>:14:13: Error: At function: Apply, At function: Udf
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
^
- <tmp_path>/program.sql:<main>:14:13: Error: UDF 'String.AsciiEqualsIgnoreCase' is not available before version 2025.02
+ <tmp_path>/program.sql:<main>:10:13: Error: UDF 'String.AsciiEqualsIgnoreCase' is not available before version 2025.02
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
^ \ No newline at end of file
diff --git a/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_scan_/extracted b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_scan_/extracted
index 6c66d69cd7f..e663ef8331c 100644
--- a/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_scan_/extracted
+++ b/yql/essentials/udfs/common/string/test/canondata/test.test_AsciiContainsIgnoreCase_2025_01_scan_/extracted
@@ -25,26 +25,8 @@
SELECT
^
<tmp_path>/program.sql:<main>:10:13: Error: At function: Apply, At function: Udf
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- ^
- <tmp_path>/program.sql:<main>:10:13: Error: UDF 'String.AsciiStartsWithIgnoreCase' is not available before version 2025.02
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- ^
- <tmp_path>/program.sql:<main>:2:1: Error: At function: SqlProjectItem, At lambda
- SELECT
- ^
- <tmp_path>/program.sql:<main>:12:13: Error: At function: Apply, At function: Udf
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
- ^
- <tmp_path>/program.sql:<main>:12:13: Error: UDF 'String.AsciiEndsWithIgnoreCase' is not available before version 2025.02
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
- ^
- <tmp_path>/program.sql:<main>:2:1: Error: At function: SqlProjectItem, At lambda
- SELECT
- ^
- <tmp_path>/program.sql:<main>:14:13: Error: At function: Apply, At function: Udf
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
^
- <tmp_path>/program.sql:<main>:14:13: Error: UDF 'String.AsciiEqualsIgnoreCase' is not available before version 2025.02
+ <tmp_path>/program.sql:<main>:10:13: Error: UDF 'String.AsciiEqualsIgnoreCase' is not available before version 2025.02
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
^ \ No newline at end of file
diff --git a/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.cfg b/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.cfg
new file mode 100644
index 00000000000..02e37255758
--- /dev/null
+++ b/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.cfg
@@ -0,0 +1,2 @@
+langver 2025.01
+in plato.Input default.in
diff --git a/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.sql b/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.sql
new file mode 100644
index 00000000000..854e414640b
--- /dev/null
+++ b/yql/essentials/udfs/common/string/test/cases/AsciiCmpIgnoreCase_AllAlternatives_2025_01.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+SELECT
+ value,
+ String::HasPrefixIgnoreCase(value, "AS") AS icprefix,
+ String::StartsWithIgnoreCase(value, "AS") AS icstarts,
+ String::AsciiStartsWithIgnoreCase(value, "AS") AS aicstarts,
+ String::HasSuffixIgnoreCase(value, "AS") AS icsuffix,
+ String::EndsWithIgnoreCase(value, "AS") AS icends,
+ String::AsciiEndsWithIgnoreCase(value, "AS") AS aicends,
+FROM Input;
diff --git a/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01.sql b/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01.sql
index db2ebad20e0..f41abd94ec4 100644
--- a/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01.sql
+++ b/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01.sql
@@ -2,8 +2,6 @@ SELECT
value,
String::AsciiContainsIgnoreCase(value, "AS") AS iccontains,
String::AsciiContainsIgnoreCase(value, "") AS icempty,
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
FROM Input;
diff --git a/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01_scan.sql b/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01_scan.sql
index db2ebad20e0..f41abd94ec4 100644
--- a/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01_scan.sql
+++ b/yql/essentials/udfs/common/string/test/cases/AsciiContainsIgnoreCase_2025_01_scan.sql
@@ -2,8 +2,6 @@ SELECT
value,
String::AsciiContainsIgnoreCase(value, "AS") AS iccontains,
String::AsciiContainsIgnoreCase(value, "") AS icempty,
- String::AsciiStartsWithIgnoreCase(value, "AS") AS icstarts,
- String::AsciiEndsWithIgnoreCase(value, "AS") AS icends,
String::AsciiEqualsIgnoreCase(value, "FDSA") AS icequals,
FROM Input;