diff options
author | zverevgeny <zverevgeny@ydb.tech> | 2023-08-15 17:00:35 +0300 |
---|---|---|
committer | zverevgeny <zverevgeny@ydb.tech> | 2023-08-15 18:24:03 +0300 |
commit | b011a40f88775f78a43c514953261f96b0d7be43 (patch) | |
tree | 917b0aded1f2b371dd83bb78e47859369b68b0f6 | |
parent | 47b2ba312324ddf016c210b2a7072b9cbb0719ee (diff) | |
download | ydb-b011a40f88775f78a43c514953261f96b0d7be43.tar.gz |
YQL-16186 dummy MATCH_RECOGNIZER formatting to pacify formatter checks
-rw-r--r-- | ydb/library/yql/sql/v1/format/sql_format.cpp | 8 | ||||
-rw-r--r-- | ydb/library/yql/sql/v1/format/sql_format_ut.cpp | 23 |
2 files changed, 28 insertions, 3 deletions
diff --git a/ydb/library/yql/sql/v1/format/sql_format.cpp b/ydb/library/yql/sql/v1/format/sql_format.cpp index 83b8b4061d..c56742d966 100644 --- a/ydb/library/yql/sql/v1/format/sql_format.cpp +++ b/ydb/library/yql/sql/v1/format/sql_format.cpp @@ -1599,8 +1599,12 @@ private: void VisitNamedSingleSource(const TRule_named_single_source& msg) { Visit(msg.GetRule_single_source1()); - //TODO handle MATCH_RECOGNIZE block - //https://st.yandex-team.ru/YQL-16186 + if (msg.HasBlock2()) { + const auto& matchRecognize = msg.GetBlock2(); + //TODO handle MATCH_RECOGNIZE block + //https://st.yandex-team.ru/YQL-16186 + Visit(matchRecognize); + } if (msg.HasBlock3()) { NewLine(); PushCurrentIndent(); diff --git a/ydb/library/yql/sql/v1/format/sql_format_ut.cpp b/ydb/library/yql/sql/v1/format/sql_format_ut.cpp index 5b65139076..14c7693c04 100644 --- a/ydb/library/yql/sql/v1/format/sql_format_ut.cpp +++ b/ydb/library/yql/sql/v1/format/sql_format_ut.cpp @@ -1305,5 +1305,26 @@ Y_UNIT_TEST_SUITE(CheckSqlFormatter) { setup.Run(cases); } - + Y_UNIT_TEST(MatchRecognize) { + TCases cases = {{R"( +pragma FeatureR010="prototype"; +USE plato; +SELECT + * +FROM Input MATCH_RECOGNIZE( + PATTERN ( A ) + DEFINE A as A +); +)", +R"(PRAGMA FeatureR010 = "prototype"; +USE plato; +SELECT + * +FROM Input MATCH_RECOGNIZE (PATTERN (A) DEFINE A AS A); + +)" + }}; + TSetup setup; + setup.Run(cases); +} } |