aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorudovichenko-r <rvu@ydb.tech>2023-10-24 21:50:50 +0300
committerudovichenko-r <rvu@ydb.tech>2023-10-24 22:13:08 +0300
commit0249dbb0588b5dfe3e4d32264d5d05edc11d614c (patch)
treecddb428e0f02ba88b415d2ab33bcfa90badb3421
parent32537eb24d6375aa4032ba0e6ca4c3b6c64ac439 (diff)
downloadydb-0249dbb0588b5dfe3e4d32264d5d05edc11d614c.tar.gz
[yql] Handle all types in MakeRepr
YQL-16934
-rw-r--r--ydb/library/yql/core/type_ann/type_ann_core.cpp15
-rw-r--r--ydb/library/yql/tests/sql/sql2yql/canondata/result.json14
-rw-r--r--ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.cfg2
-rw-r--r--ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.sql10
-rw-r--r--ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json21
5 files changed, 61 insertions, 1 deletions
diff --git a/ydb/library/yql/core/type_ann/type_ann_core.cpp b/ydb/library/yql/core/type_ann/type_ann_core.cpp
index 085a288b87..fbce6e72d3 100644
--- a/ydb/library/yql/core/type_ann/type_ann_core.cpp
+++ b/ydb/library/yql/core/type_ann/type_ann_core.cpp
@@ -182,6 +182,10 @@ namespace NTypeAnnImpl {
case ETypeAnnotationKind::Null:
case ETypeAnnotationKind::EmptyList:
case ETypeAnnotationKind::EmptyDict:
+ case ETypeAnnotationKind::Error:
+ case ETypeAnnotationKind::Pg:
+ case ETypeAnnotationKind::Block:
+ case ETypeAnnotationKind::Scalar:
return { input, type };
case ETypeAnnotationKind::Optional: {
@@ -418,7 +422,16 @@ namespace NTypeAnnImpl {
return { ctx.NewCallable(input->Pos(), "Visit", std::move(visitArgs)), newVType };
}
- default:
+ case ETypeAnnotationKind::Unit:
+ case ETypeAnnotationKind::World:
+ case ETypeAnnotationKind::Callable:
+ case ETypeAnnotationKind::Item:
+ case ETypeAnnotationKind::Type:
+ case ETypeAnnotationKind::Generic:
+ case ETypeAnnotationKind::Stream:
+ case ETypeAnnotationKind::Flow:
+ case ETypeAnnotationKind::Multi:
+ case ETypeAnnotationKind::LastType:
return { nullptr, nullptr };
}
}
diff --git a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
index 7c3e7a47a0..0535bc0876 100644
--- a/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
+++ b/ydb/library/yql/tests/sql/sql2yql/canondata/result.json
@@ -14405,6 +14405,13 @@
"uri": "https://storage.yandex-team.ru/get-devtools/1936947/659b615f15086142a8960946dabd06b519d43335/resource.tar.gz#test_sql2yql.test_select-match_clause_/sql.yql"
}
],
+ "test_sql2yql.test[select-missing_with_nonpersist]": [
+ {
+ "checksum": "58b257f20699b68962915097bf6651fb",
+ "size": 2298,
+ "uri": "https://storage.yandex-team.ru/get-devtools/1777230/9eb6e3cefee21d5673c1d229fde4bb222b05cae6/resource.tar.gz#test_sql2yql.test_select-missing_with_nonpersist_/sql.yql"
+ }
+ ],
"test_sql2yql.test[select-multi_source_issue]": [
{
"checksum": "bfdc120812095874c51804b9ca95a682",
@@ -29007,6 +29014,13 @@
"uri": "https://storage.yandex-team.ru/get-devtools/1599023/4bd7e6892a9762eec433e60bda88f20cddadc74c/resource.tar.gz#test_sql_format.test_select-match_clause_/formatted.sql"
}
],
+ "test_sql_format.test[select-missing_with_nonpersist]": [
+ {
+ "checksum": "2c27a7b616851eb6fb571634a1ca676e",
+ "size": 189,
+ "uri": "https://storage.yandex-team.ru/get-devtools/1777230/9eb6e3cefee21d5673c1d229fde4bb222b05cae6/resource.tar.gz#test_sql_format.test_select-missing_with_nonpersist_/formatted.sql"
+ }
+ ],
"test_sql_format.test[select-multi_source_issue]": [
{
"checksum": "0f40bbe9b158b0542547249cd6785b4a",
diff --git a/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.cfg b/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.cfg
new file mode 100644
index 0000000000..1f1d2747db
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+providers yt
diff --git a/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.sql b/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.sql
new file mode 100644
index 0000000000..82fe2a092b
--- /dev/null
+++ b/ydb/library/yql/tests/sql/suites/select/missing_with_nonpersist.sql
@@ -0,0 +1,10 @@
+USE plato;
+
+$data = select
+ Yson::Parse(cast(key as Yson)) as key,
+ text, -- missing colums
+ subkey
+from Input;
+
+select key, subkey
+from $data;
diff --git a/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json b/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
index f4badb0ef0..30f54615af 100644
--- a/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
+++ b/ydb/library/yql/tests/sql/yt_native_file/part5/canondata/result.json
@@ -4643,6 +4643,27 @@
"uri": "https://storage.yandex-team.ru/get-devtools/1937150/b466c661905bdae484e68f0651bb2615aefc377c/resource.tar.gz#test.test_select-hits_count--Results_/results.txt"
}
],
+ "test.test[select-missing_with_nonpersist--Debug]": [
+ {
+ "checksum": "0f051ba306a105562ace3708fe976206",
+ "size": 1463,
+ "uri": "https://storage.yandex-team.ru/get-devtools/1777230/dd11e3ca4160cfc1a343ea65b89d1ad147225023/resource.tar.gz#test.test_select-missing_with_nonpersist--Debug_/opt.yql"
+ }
+ ],
+ "test.test[select-missing_with_nonpersist--Plan]": [
+ {
+ "checksum": "88053dabda59eb5641b248ea1be56e52",
+ "size": 3529,
+ "uri": "https://storage.yandex-team.ru/get-devtools/1777230/dd11e3ca4160cfc1a343ea65b89d1ad147225023/resource.tar.gz#test.test_select-missing_with_nonpersist--Plan_/plan.txt"
+ }
+ ],
+ "test.test[select-missing_with_nonpersist--Results]": [
+ {
+ "checksum": "498aadec39422cf53a0fec6d3cd2cd50",
+ "size": 2129,
+ "uri": "https://storage.yandex-team.ru/get-devtools/1777230/dd11e3ca4160cfc1a343ea65b89d1ad147225023/resource.tar.gz#test.test_select-missing_with_nonpersist--Results_/results.txt"
+ }
+ ],
"test.test[select-null_check-default.txt-Debug]": [
{
"checksum": "e768095b6638345170e1ac470f10a517",