Skip to content

Commit

Permalink
init (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn authored Feb 7, 2024
1 parent 1969f60 commit b4cd18c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 41 deletions.
2 changes: 1 addition & 1 deletion ydb/library/yql/sql/v1/SQLv1.g.in
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ fragment STRING_SINGLE: (QUOTE_SINGLE STRING_CORE_SINGLE* QUOTE_SINGLE);
fragment STRING_DOUBLE: (QUOTE_DOUBLE STRING_CORE_DOUBLE* QUOTE_DOUBLE);
fragment STRING_MULTILINE: (DOUBLE_AT .* DOUBLE_AT)+ AT?;

STRING_VALUE: ((STRING_SINGLE | STRING_DOUBLE | STRING_MULTILINE) (S | B | T | U | Y | J | P (T | B | V)?)?);
STRING_VALUE: ((STRING_SINGLE | STRING_DOUBLE | STRING_MULTILINE) (S | U | Y | J | P (T | B | V)?)?);

ID_PLAIN: ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | DIGIT)*;

Expand Down
6 changes: 3 additions & 3 deletions ydb/library/yql/sql/v1/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,16 +1424,16 @@ StringContentInternal(TContext& ctx, TPosition pos, const TString& input, EStrin
} else if (lower.EndsWith("pv")) {
str = str.substr(0, str.Size() - 2);
result.PgType = "PgVarchar";
} else if (lower.EndsWith("s") || lower.EndsWith("b")) {
} else if (lower.EndsWith("s")) {
str = str.substr(0, str.Size() - 1);
result.Type = NKikimr::NUdf::EDataSlot::String;
} else if (lower.EndsWith("u") || lower.EndsWith("t")) {
} else if (lower.EndsWith("u")) {
str = str.substr(0, str.Size() - 1);
result.Type = NKikimr::NUdf::EDataSlot::Utf8;
} else {
if (ctx.Scoped->WarnUntypedStringLiterals) {
ctx.Warning(pos, TIssuesIds::YQL_UNTYPED_STRING_LITERALS)
<< "Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings";
<< "Please add suffix u for Utf8 strings or s for arbitrary binary strings";
}

if (ctx.Scoped->UnicodeLiterals) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,9 @@
],
"test.test[expr-unicode_literals-default.txt-Debug]": [
{
"checksum": "9201dbe44a3334deb0a063d58468a160",
"size": 522,
"uri": "https://{canondata_backend}/1871002/fb6fb37c565974a6f0c497e8b3e58f6b5bf320b2/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Debug_/opt.yql_patched"
"checksum": "a65d6b9299b9ecfa68d1377414a3d814",
"size": 462,
"uri": "https://{canondata_backend}/1925842/c2ce7c5eeafa7c99dd47a4e0bc6a7304dd057c69/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Debug_/opt.yql_patched"
}
],
"test.test[expr-unicode_literals-default.txt-Plan]": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^
12 changes: 6 additions & 6 deletions ydb/library/yql/tests/sql/sql2yql/canondata/result.json
Original file line number Diff line number Diff line change
Expand Up @@ -5804,9 +5804,9 @@
],
"test_sql2yql.test[expr-unicode_literals]": [
{
"checksum": "9be93914e3d28b675e0eee080ef248ec",
"size": 1964,
"uri": "https://{canondata_backend}/1937367/9f749035d8f07b7ae5537f5aebd224641b378134/resource.tar.gz#test_sql2yql.test_expr-unicode_literals_/sql.yql"
"checksum": "ee24a9f27885bf7ae3f4b2db0d677a0a",
"size": 1912,
"uri": "https://{canondata_backend}/1777230/02994451d1c8953a8e9142350351d7282debc251/resource.tar.gz#test_sql2yql.test_expr-unicode_literals_/sql.yql"
}
],
"test_sql2yql.test[expr-untag]": [
Expand Down Expand Up @@ -23304,9 +23304,9 @@
],
"test_sql_format.test[expr-unicode_literals]": [
{
"checksum": "b470490a33e28dd2537f12d80329216a",
"size": 374,
"uri": "https://{canondata_backend}/1937367/9f749035d8f07b7ae5537f5aebd224641b378134/resource.tar.gz#test_sql_format.test_expr-unicode_literals_/formatted.sql"
"checksum": "e8e56821ff77c888713ff8852fb1518a",
"size": 318,
"uri": "https://{canondata_backend}/1777230/02994451d1c8953a8e9142350351d7282debc251/resource.tar.gz#test_sql_format.test_expr-unicode_literals_/formatted.sql"
}
],
"test_sql_format.test[expr-untag]": [
Expand Down
12 changes: 4 additions & 8 deletions ydb/library/yql/tests/sql/suites/expr/unicode_literals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ pragma UnicodeLiterals;
$f = ()->{
return (
"a"s,
"b"b,
"c"t,
"d"u,
"e");
"b"u,
"c");
};

select $f();
Expand All @@ -16,10 +14,8 @@ pragma DisableUnicodeLiterals;
$g = ()->{
return (
"a"s,
"b"b,
"c"t,
"d"u,
"e");
"b"u,
"c");
};

select $g();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,9 @@
],
"test.test[expr-unicode_literals-default.txt-Debug]": [
{
"checksum": "b21fde16b24ef5500d9c21f811fc800b",
"size": 452,
"uri": "https://{canondata_backend}/1942671/fe81aca6675f95264895c6b4c3bafedf6b92cfd5/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Debug_/opt.yql"
"checksum": "3f03a04f8c9c6e18430956926497586a",
"size": 394,
"uri": "https://{canondata_backend}/1777230/7741a861d2b9bc50c005d3f3c3fb85c0e7005074/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Debug_/opt.yql"
}
],
"test.test[expr-unicode_literals-default.txt-Plan]": [
Expand All @@ -1041,9 +1041,9 @@
],
"test.test[expr-unicode_literals-default.txt-Results]": [
{
"checksum": "634838888e147228dfbca0438c1c75d5",
"size": 3698,
"uri": "https://{canondata_backend}/1942671/fe81aca6675f95264895c6b4c3bafedf6b92cfd5/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Results_/results.txt"
"checksum": "2b32d6241e0e4814c15d8c9eae970191",
"size": 2794,
"uri": "https://{canondata_backend}/1777230/7741a861d2b9bc50c005d3f3c3fb85c0e7005074/resource.tar.gz#test.test_expr-unicode_literals-default.txt-Results_/results.txt"
},
{
"uri": "file://test.test_expr-unicode_literals-default.txt-Results_/extracted"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<tmp_path>/program.sql:<main>: Warning: Parse Sql

<tmp_path>/program.sql:<main>:9:6: Warning: Please add suffix u or t for Utf8 strings or s or b for arbitrary binary strings
"e");
<tmp_path>/program.sql:<main>:7:6: Warning: Please add suffix u for Utf8 strings or s for arbitrary binary strings
"c");
^

0 comments on commit b4cd18c

Please sign in to comment.