aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql
diff options
context:
space:
mode:
authoratarasov5 <atarasov5@yandex-team.com>2025-06-06 11:10:22 +0300
committeratarasov5 <atarasov5@yandex-team.com>2025-06-06 11:42:27 +0300
commit2443db636d1be273f42c843614117df0a584eb87 (patch)
treea2b20e40435092534f8d5563be5860b206f59c24 /yql/essentials/tests/sql
parent1df1c560c27a041991c7fc59bcdf232eb57ad11f (diff)
downloadydb-2443db636d1be273f42c843614117df0a584eb87.tar.gz
Fix block coalesce for multioptional
commit_hash:a9766abf73088d74351c34d5136a3eeb7191ac04
Diffstat (limited to 'yql/essentials/tests/sql')
-rw-r--r--yql/essentials/tests/sql/minirun/part8/canondata/result.json21
-rw-r--r--yql/essentials/tests/sql/sql2yql/canondata/result.json12
-rw-r--r--yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_blocks-coalesce_multi_optional_data_type_/formatted.sql12
-rw-r--r--yql/essentials/tests/sql/suites/blocks/coalesce_multi_optional_data_type.sql7
4 files changed, 52 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/minirun/part8/canondata/result.json b/yql/essentials/tests/sql/minirun/part8/canondata/result.json
index f3b86c1b853..7d19f5f440d 100644
--- a/yql/essentials/tests/sql/minirun/part8/canondata/result.json
+++ b/yql/essentials/tests/sql/minirun/part8/canondata/result.json
@@ -415,6 +415,27 @@
"uri": "https://{canondata_backend}/1942671/1fe07dc7779a4d1b05048ad4f78bfbeb3a86d998/resource.tar.gz#test.test_blocks-and_scalar-default.txt-Results_/results.txt"
}
],
+ "test.test[blocks-coalesce_multi_optional_data_type-default.txt-Debug]": [
+ {
+ "checksum": "703781d7b24f8fda6e7bbe53f19d2d46",
+ "size": 684,
+ "uri": "https://{canondata_backend}/1937001/26b879fa17edc79687f71103ac1dacc46f13313b/resource.tar.gz#test.test_blocks-coalesce_multi_optional_data_type-default.txt-Debug_/opt.yql"
+ }
+ ],
+ "test.test[blocks-coalesce_multi_optional_data_type-default.txt-Peephole]": [
+ {
+ "checksum": "38287310a981017fcf2fa2cf7b482d4f",
+ "size": 891,
+ "uri": "https://{canondata_backend}/1937001/26b879fa17edc79687f71103ac1dacc46f13313b/resource.tar.gz#test.test_blocks-coalesce_multi_optional_data_type-default.txt-Peephole_/opt.yql"
+ }
+ ],
+ "test.test[blocks-coalesce_multi_optional_data_type-default.txt-Results]": [
+ {
+ "checksum": "7a7cea34c78daabd97b4efd9bb9f74bf",
+ "size": 1160,
+ "uri": "https://{canondata_backend}/1937001/26b879fa17edc79687f71103ac1dacc46f13313b/resource.tar.gz#test.test_blocks-coalesce_multi_optional_data_type-default.txt-Results_/results.txt"
+ }
+ ],
"test.test[blocks-if-default.txt-Debug]": [
{
"checksum": "05045689a237cf4db264b77935b5a418",
diff --git a/yql/essentials/tests/sql/sql2yql/canondata/result.json b/yql/essentials/tests/sql/sql2yql/canondata/result.json
index 8524b042474..d85a9637192 100644
--- a/yql/essentials/tests/sql/sql2yql/canondata/result.json
+++ b/yql/essentials/tests/sql/sql2yql/canondata/result.json
@@ -1504,6 +1504,13 @@
"uri": "https://{canondata_backend}/1916746/15a617669fb2b654b6be1fc493d61b99fb1f6f81/resource.tar.gz#test_sql2yql.test_blocks-coalesce_/sql.yql"
}
],
+ "test_sql2yql.test[blocks-coalesce_multi_optional_data_type]": [
+ {
+ "checksum": "39b96da74e77b42935e1bb75ff35c325",
+ "size": 1613,
+ "uri": "https://{canondata_backend}/212715/cb3b5f6baa9f825ff71deb34e4af1d03b8da5f7a/resource.tar.gz#test_sql2yql.test_blocks-coalesce_multi_optional_data_type_/sql.yql"
+ }
+ ],
"test_sql2yql.test[blocks-coalesce_scalar]": [
{
"checksum": "3cf278b8eccf4bbed173c5075bffcf53",
@@ -8592,6 +8599,11 @@
"uri": "file://test_sql_format.test_blocks-coalesce_/formatted.sql"
}
],
+ "test_sql_format.test[blocks-coalesce_multi_optional_data_type]": [
+ {
+ "uri": "file://test_sql_format.test_blocks-coalesce_multi_optional_data_type_/formatted.sql"
+ }
+ ],
"test_sql_format.test[blocks-coalesce_scalar]": [
{
"uri": "file://test_sql_format.test_blocks-coalesce_scalar_/formatted.sql"
diff --git a/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_blocks-coalesce_multi_optional_data_type_/formatted.sql b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_blocks-coalesce_multi_optional_data_type_/formatted.sql
new file mode 100644
index 00000000000..c04cb37ddaf
--- /dev/null
+++ b/yql/essentials/tests/sql/sql2yql/canondata/test_sql_format.test_blocks-coalesce_multi_optional_data_type_/formatted.sql
@@ -0,0 +1,12 @@
+$data = [
+ <|optionalValue: Just(Just(4)), optionalValue2: Just(404)|>,
+ <|optionalValue: Just(Nothing(int32?)), optionalValue2: Just(404)|>,
+ <|optionalValue: Just(Just(404)), optionalValue2: Just(404)|>,
+ <|optionalValue: Nothing(int32??), optionalValue2: Nothing(int32?)|>,
+];
+
+SELECT
+ Coalesce(optionalValue, optionalValue2)
+FROM
+ as_table($data)
+;
diff --git a/yql/essentials/tests/sql/suites/blocks/coalesce_multi_optional_data_type.sql b/yql/essentials/tests/sql/suites/blocks/coalesce_multi_optional_data_type.sql
new file mode 100644
index 00000000000..93293d9cb54
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/blocks/coalesce_multi_optional_data_type.sql
@@ -0,0 +1,7 @@
+$data = [<|optionalValue: Just(Just(4)), optionalValue2: Just(404)|>,
+ <|optionalValue: Just(Nothing(int32?)), optionalValue2: Just(404)|>,
+ <|optionalValue: Just(Just(404)), optionalValue2: Just(404)|>,
+ <|optionalValue: Nothing(int32??), optionalValue2: Nothing(int32?)|>,];
+
+
+SELECT Coalesce(optionalValue, optionalValue2) FROM as_table($data);