aboutsummaryrefslogtreecommitdiffstats
path: root/yql
diff options
context:
space:
mode:
authorzhvv117 <zhvv117@yandex-team.com>2025-01-30 17:49:50 +0300
committerzhvv117 <zhvv117@yandex-team.com>2025-01-30 18:35:53 +0300
commit3ac747f4670e54f1073374b9cfa7ca8fc7c4e89c (patch)
tree03cbbe6ec5819e34d236d840be6bac7244ba3e56 /yql
parent61a153ab502fb7c2bfe92fbe0b805583aa77b061 (diff)
downloadydb-3ac747f4670e54f1073374b9cfa7ca8fc7c4e89c.tar.gz
Do not remove newlines from type description in table hints
commit_hash:583776586a8abaa44b1dd77e7dd2bd9e7c1c5031
Diffstat (limited to 'yql')
-rw-r--r--yql/essentials/sql/v1/format/sql_format.cpp2
-rw-r--r--yql/essentials/sql/v1/format/sql_format_ut.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp
index 26d7eb9287..3b180827a6 100644
--- a/yql/essentials/sql/v1/format/sql_format.cpp
+++ b/yql/essentials/sql/v1/format/sql_format.cpp
@@ -574,7 +574,7 @@ private:
ForceExpandedLine = token.GetLine();
}
- const bool expr = (descr == TRule_expr::GetDescriptor() || descr == TRule_in_expr::GetDescriptor());
+ const bool expr = (descr == TRule_expr::GetDescriptor() || descr == TRule_in_expr::GetDescriptor() || descr == TRule_type_name_composite::GetDescriptor());
if (expr) {
++InsideExpr;
}
diff --git a/yql/essentials/sql/v1/format/sql_format_ut.h b/yql/essentials/sql/v1/format/sql_format_ut.h
index 722863ecaa..0960fec3b6 100644
--- a/yql/essentials/sql/v1/format/sql_format_ut.h
+++ b/yql/essentials/sql/v1/format/sql_format_ut.h
@@ -1015,6 +1015,8 @@ Y_UNIT_TEST(TableHints) {
"SELECT\n\t*\nFROM\n\tplato.T WITH SCHEMA struct<foo: integer, Bar: list<string?>>\nWHERE\n\tkey < 0\n;\n"},
{"select * from plato.T with (foo=bar, x=$y, a=(a, b, c), u='aaa', schema (foo int32, bar list<string>))",
"SELECT\n\t*\nFROM\n\tplato.T WITH (\n\t\tfoo = bar,\n\t\tx = $y,\n\t\ta = (a, b, c),\n\t\tu = 'aaa',\n\t\tSCHEMA (foo int32, bar list<string>)\n\t)\n;\n"},
+ {"select * from plato.T with schema struct<\nfoo:int32,\nbar:double\n> as a",
+ "SELECT\n\t*\nFROM\n\tplato.T WITH SCHEMA struct<\n\t\tfoo: int32,\n\t\tbar: double\n\t> AS a\n;\n"},
};
TSetup setup;