From ddedfffe40c70e7b353843176a4d4647c19bbba2 Mon Sep 17 00:00:00 2001 From: udovichenko-r Date: Thu, 18 Jun 2026 19:58:57 +0300 Subject: SQL parser + type annotation for Materialize statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### SQL Parser and Type Annotation for Materialize Statement ✎ - Added support for the `MATERIALIZE` SQL statement including parser rules and syntax highlighting updates - Implemented type annotation and validation for the `MATERIALIZE` statement with proper error handling - Enhanced SQL query processing to handle `MATERIALIZE` statements in various contexts including subqueries and limited views - Added runtime support for `MATERIALIZE` operations with sort preservation and proper data sink handling - Integrated `MATERIALIZE` into the SQL grammar and updated completion suggestions - Added comprehensive unit tests covering various `MATERIALIZE` scenarios and edge cases Autodescription by Yandex Code Assistant commit_hash:32b04f93ceadf624b4d39fd6512798f9354bfd80 --- yql/essentials/sql/v1/format/sql_format.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'yql/essentials/sql/v1/format/sql_format.cpp') diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp index d2f5a488849..3d6ff416ddd 100644 --- a/yql/essentials/sql/v1/format/sql_format.cpp +++ b/yql/essentials/sql/v1/format/sql_format.cpp @@ -1127,6 +1127,11 @@ private: VisitAllFields(TRule_truncate_table_stmt::GetDescriptor(), msg); } + void VisitMaterialize(const TRule_materialize_stmt& msg) { + NewLine(); + VisitAllFields(TRule_materialize_stmt::GetDescriptor(), msg); + } + void VisitCreateTable(const TRule_create_table_stmt& msg) { NewLine(); Visit(msg.GetToken1()); @@ -3406,6 +3411,7 @@ TStaticData::TStaticData() {TRule_alter_sequence_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitAlterSequence)}, {TRule_alter_database_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitAlterDatabase)}, {TRule_truncate_table_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitTruncateTable)}, + {TRule_materialize_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitMaterialize)}, {TRule_show_create_table_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitShowCreateTable)}, {TRule_streaming_query_settings::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitStreamingQuerySettings)}, {TRule_create_streaming_query_stmt::GetDescriptor(), MakePrettyFunctor(&TPrettyVisitor::VisitCreateStreamingQuery)}, -- cgit v1.3