-
Notifications
You must be signed in to change notification settings - Fork 735
Support ALTER OBJECT for SHOW CREATE TABLE #18493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ALTER OBJECT for SHOW CREATE TABLE #18493
Conversation
|
🟢 |
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
| json["bits_storage_type"] = bitsStorage.GetClassName(); | ||
| } | ||
| } | ||
| if (bloomNGrammFilter.HasRecordsCount()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
здесь есть какие-то отличия от library/cpp/protobuf/json библиотеки? как будто тут много кода, который на самом деле не нужен, а достаточно просто library/cpp/protobuf/json либу заиспользовать.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отличия есть, какие-то промежуточные поля не выводятся
Ну и в обратную сторону эти jsonы парсятся руками
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
|
||
| if (!schema.GetIndexes().empty()) { | ||
| for (const auto& index : schema.GetIndexes()) { | ||
| FormatUpsertIndex(fullPath, index, columns); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а тут?
| if (bloomNGrammFilter.HasFilterSizeBytes()) { | ||
| json["filter_size_bytes"] = bloomNGrammFilter.GetFilterSizeBytes(); | ||
| } | ||
| if (bloomNGrammFilter.HasFilterSizeBytes()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это баг или действительно тут должен быть такой if?
There was a problem hiding this 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 adds support for the ALTER OBJECT operations in the SHOW CREATE TABLE statements by extending unit tests and updating configuration and formatter functions.
- Adds several unit tests in ut_kqp.cpp for various ALTER OBJECT actions (ALTER_COLUMN, UPSERT_OPTIONS, UPSERT_INDEX).
- Introduces new configuration flags in TTestEnvSettings and updates feature flags and app configuration accordingly.
- Updates the create table formatter API and related dependencies to handle additional formatting options.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ydb/core/sys_view/ut_kqp.cpp | New unit tests for ALTER OBJECT functionality in SHOW CREATE TABLE operations. |
| ydb/core/sys_view/ut_common.h | Added new flags to enable ALTER OBJECT and related features. |
| ydb/core/sys_view/ut_common.cpp | Updated feature flag settings to support new functionalities. |
| ydb/core/sys_view/show_create/ya.make | Added dependency on the arrow serializer required by new functionality. |
| ydb/core/sys_view/show_create/show_create.cpp | Updated the formatter call to pass the full path for table formatting. |
| ydb/core/sys_view/show_create/formatters_common.{h,cpp} | New escape function for boolean values added to support formatting needs. |
| ydb/core/sys_view/show_create/create_table_formatter.h | Updated Format signature and added new functions for ALTER_COLUMN, UPSERT_INDEX, and UPSERT_OPTIONS. |
Comments suppressed due to low confidence (1)
ydb/core/sys_view/ut_kqp.cpp:2137
- Inconsistent table path formatting: the object path here is missing a leading '/' compared to other ALTER OBJECT commands. Consider using
/Root/test_show_createconsistently.
ALTER OBJECT `Root/test_show_create` (TYPE TABLE) SET (ACTION=UPSERT_INDEX, NAME=bloom_filter_index, TYPE=BLOOM_FILTER, FEATURES=`{"column_name" : "Col2", "false_positive_probability" : 0.01}`);
| "records_count" : 1024, "case_sensitive" : true, "data_extractor" : {"class_name" : "SUB_COLUMN", "sub_column_name" : "a"}}`); | ||
| ALTER OBJECT `Root/test_show_create` (TYPE TABLE) SET (ACTION=UPSERT_INDEX, NAME=bloom_filter_index, TYPE=BLOOM_FILTER, | ||
| FEATURES=`{"column_name" : "Col2", "false_positive_probability" : 0.01}`); | ||
| ALTER OBJECT `Root/test_show_create` (TYPE TABLE) SET (ACTION=UPSERT_INDEX, NAME=max_index, TYPE=MAX, FEATURES=`{"column_name": "Col2"}`); |
Copilot
AI
May 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ALTER OBJECT statement here also omits the leading '/' in the table path. For clarity and consistency, ensure that the table path is uniformly formatted as /Root/test_show_create.
Changelog category
Description for reviewers
Support ALTER OBJECT for SHOW CREATE TABLE