diff options
author | avevad <avevad@yandex-team.com> | 2024-12-13 14:25:35 +0300 |
---|---|---|
committer | avevad <avevad@yandex-team.com> | 2024-12-13 15:28:58 +0300 |
commit | 8970a1a0e4f5cb97926644f3f75768d860d09ef9 (patch) | |
tree | 0a90a9738b10ca9558dad1b792ca76c842df2e55 /yql/essentials/tests/sql/suites | |
parent | 84872c9673776978453258b23ba78fb2a6f32d85 (diff) | |
download | ydb-8970a1a0e4f5cb97926644f3f75768d860d09ef9.tar.gz |
YQL-19163 Fix StaticFold behavior with optional args lambdas
commit_hash:bbea0c78d15d9ba627f15182d80dd2406a494b93
Diffstat (limited to 'yql/essentials/tests/sql/suites')
-rw-r--r-- | yql/essentials/tests/sql/suites/expr/static_fold.sql | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/yql/essentials/tests/sql/suites/expr/static_fold.sql b/yql/essentials/tests/sql/suites/expr/static_fold.sql index 9118da0e06..81444ea9b3 100644 --- a/yql/essentials/tests/sql/suites/expr/static_fold.sql +++ b/yql/essentials/tests/sql/suites/expr/static_fold.sql @@ -18,4 +18,16 @@ SELECT StaticFold1($st_many, $start, $concat), StaticFold1($st_single, $start, $concat), CAST(StaticFold1($st_empty, $start, $concat) AS Optional<String>), - StaticFold1($tup, $start, $concat);
\ No newline at end of file + StaticFold1($tup, $start, $concat); + +--WithOptionalArgs lambda test +$puk = ($row_struct) -> { + RETURN StaticFold( + $row_struct, + 0, + ($item, $sum?) -> { + RETURN $sum + IF($item IS NULL, 0, 1) + } + ) +}; +SELECT $puk(Unwrap(CAST(<|one:"8912", two:42|> AS Struct<one: Int64, two:Int64>)));
\ No newline at end of file |