Skip to content

Conversation

1NepuNep1
Copy link
Collaborator

@1NepuNep1 1NepuNep1 commented Sep 3, 2025

  • pragma_stmt
  • select_stmt
  • named_nodes_stmt
  • create_table_stmt
  • drop_table_stmt
  • use_stmt
  • into_table_stmt
  • commit_stmt
  • update_stmt
  • delete_stmt
  • rollback_stmt
  • declare_stmt
  • import_stmt
  • export_stmt
  • alter_table_stmt (upd)
  • alter_external_table_stmt
  • do_stmt (upd)
  • define_action_or_subquery_stmt
  • if_stmt
  • for_stmt
  • values_stmt
  • create_user_stmt
  • alter_user_stmt
  • create_group_stmt
  • alter_group_stmt
  • drop_role_stmt
  • create_object_stmt
  • alter_object_stmt
  • drop_object_stmt
  • create_external_data_source_stmt
  • alter_external_data_source_stmt
  • drop_external_data_source_stmt
  • create_replication_stmt
  • drop_replication_stmt
  • create_topic_stmt
  • alter_topic_stmt
  • drop_topic_stmt
  • grant_permissions_stmt
  • revoke_permissions_stmt
  • alter_table_store_stmt
  • upsert_object_stmt
  • create_view_stmt
  • drop_view_stmt
  • alter_replication_stmt
  • create_resource_pool_stmt
  • alter_resource_pool_stmt
  • drop_resource_pool_stmt
  • create_backup_collection_stmt
  • alter_backup_collection_stmt
  • drop_backup_collection_stmt
  • analyze_stmt
  • create_resource_pool_classifier_stmt
  • alter_resource_pool_classifier_stmt
  • drop_resource_pool_classifier_stmt
  • backup_stmt
  • restore_stmt
  • alter_sequence_stmt
  • create_transfer_stmt
  • alter_transfer_stmt
  • drop_transfer_stmt
  • alter_database_stmt
  • show_create_table_stmt
@1NepuNep1 1NepuNep1 requested a review from Copilot September 4, 2025 17:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR significantly expands YQL (Yandex Query Language) syntax support in the sqlc engine by implementing multiple statement types and enhancing the SELECT statement parser. The changes focus on adding comprehensive support for DDL operations, DML operations, and improving the robustness of SELECT statement parsing.

  • Implements support for 14 new YQL statement types including ALTER TABLE, DO, and various user/group management statements
  • Enhances SELECT statement parsing with support for UNION operations, ORDER BY, LIMIT/OFFSET, GROUP BY with ROLLUP/CUBE, and HAVING clauses
  • Refactors utility functions to improve naming consistency and adds new parsing functions for table identifiers

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
internal/engine/ydb/utils.go Refactors identifier parsing functions and adds new parseAnIdTable function
internal/engine/ydb/convert.go Implements converters for ALTER TABLE and DO statements, significantly enhances SELECT statement parsing with comprehensive clause support
internal/engine/ydb/catalog_tests/select_test.go Updates test cases to match new SELECT statement AST structure with additional fields
internal/engine/ydb/catalog_tests/delete_test.go Updates DELETE test case to include new SELECT statement fields
Comments suppressed due to low confidence (1)

internal/engine/ydb/convert.go:1

  • [nitpick] These error messages should be more descriptive about what the user should do. Consider messages like 'YDB: INTERSECT operation is not yet supported in this version' or provide guidance on alternatives.
package ydb 

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Subtype: ast.AT_DropColumn,
})
}
case action.Alter_table_alter_column_drop_not_null() != nil:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как будто бы можно объединить с action.Alter_table_drop_column() и избежать дублирования

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется там будет больше геморроя их объединять 😄 . У них единственное общее та - an_id, который к тому же из разных структур достается, мне кажется бессмысленная оптимизация

}

switch {
case n.Call_action() != nil:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно каждой ветке в switch выделить по отдельному методу для упрощения кода

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я на самом деле специально так сделал. В грамматике call_action и inline_action встречаются 1 раз - тут. И вот обычно, когда приходится обрабатывать такие одноразовые штуки, я прям так и записываю их, чтоб не путать человека, который в будущем код будет допиливать. Не знаю если честно, валиден такой подход или нет

@1NepuNep1 1NepuNep1 merged commit f2d7aea into ydb-platform:ydb Sep 8, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants