Skip to content

Conversation

@shnikd
Copy link
Contributor

@shnikd shnikd commented May 19, 2025

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

Support ALTER OBJECT for SHOW CREATE TABLE

@github-actions
Copy link

github-actions bot commented May 19, 2025

🟢 2025-05-19 11:23:48 UTC The validation of the Pull Request description is successful.

dorooleg
dorooleg previously approved these changes May 19, 2025
@github-actions
Copy link

github-actions bot commented May 19, 2025

2025-05-19 11:57:23 UTC Pre-commit check linux-x86_64-release-asan for 6e52712 has started.
2025-05-19 11:57:27 UTC Artifacts will be uploaded here
2025-05-19 12:00:22 UTC ya make is running...
🟡 2025-05-19 13:28:02 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
13149 13002 0 90 31 26

2025-05-19 13:29:10 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-19 14:02:22 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1394 (only retried tests) 1296 0 59 12 27

2025-05-19 14:02:42 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-05-19 14:36:08 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1340 (only retried tests) 1235 0 55 25 25

🟢 2025-05-19 14:36:23 UTC Build successful.
🟡 2025-05-19 14:36:57 UTC ydbd size 3.9 GiB changed* by +192.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: b2e4183 merge: 6e52712 diff diff %
ydbd size 4 141 801 824 Bytes 4 141 999 264 Bytes +192.8 KiB +0.005%
ydbd stripped size 1 437 655 000 Bytes 1 437 721 176 Bytes +64.6 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented May 19, 2025

2025-05-19 12:24:15 UTC Pre-commit check linux-x86_64-relwithdebinfo for 6e52712 has started.
2025-05-19 12:24:47 UTC Artifacts will be uploaded here
2025-05-19 12:28:41 UTC ya make is running...
🟡 2025-05-19 13:34:24 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
21072 19695 0 4 1338 35

2025-05-19 13:36:09 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-05-19 14:00:41 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
399 (only retried tests) 366 0 0 1 32

🟢 2025-05-19 14:00:50 UTC Build successful.
🟡 2025-05-19 14:01:14 UTC ydbd size 2.2 GiB changed* by +107.4 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: b7d9010 merge: 6e52712 diff diff %
ydbd size 2 354 365 360 Bytes 2 354 475 360 Bytes +107.4 KiB +0.005%
ydbd stripped size 494 718 792 Bytes 494 743 176 Bytes +23.8 KiB +0.005%

*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()) {
Copy link
Member

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 либу заиспользовать.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Отличия есть, какие-то промежуточные поля не выводятся
Ну и в обратную сторону эти jsonы парсятся руками

@github-actions
Copy link

github-actions bot commented May 19, 2025

2025-05-19 14:56:46 UTC Pre-commit check linux-x86_64-release-asan for 6a5f2fe has started.
2025-05-19 14:56:50 UTC Artifacts will be uploaded here
2025-05-19 14:59:51 UTC ya make is running...
🟡 2025-05-19 16:44:59 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
13150 12985 0 95 44 26

2025-05-19 16:46:08 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-19 17:15:21 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1197 (only retried tests) 1108 0 54 12 23

2025-05-19 17:15:36 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-05-19 17:45:02 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1000 (only retried tests) 898 0 53 27 22

🟢 2025-05-19 17:45:13 UTC Build successful.
🟢 2025-05-19 17:45:48 UTC ydbd size 3.9 GiB changed* by -11.6 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: a487c8d merge: 6a5f2fe diff diff %
ydbd size 4 141 801 824 Bytes 4 141 789 936 Bytes -11.6 KiB -0.000%
ydbd stripped size 1 437 655 000 Bytes 1 437 648 280 Bytes -6.6 KiB -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented May 19, 2025

2025-05-19 15:16:47 UTC Pre-commit check linux-x86_64-relwithdebinfo for 6a5f2fe has started.
2025-05-19 15:16:53 UTC Artifacts will be uploaded here
2025-05-19 15:19:48 UTC ya make is running...
🟡 2025-05-19 16:29:14 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
21073 19706 0 3 1326 38

2025-05-19 16:30:57 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-05-19 16:55:58 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
120 (only retried tests) 89 0 0 1 30

🟢 2025-05-19 16:56:05 UTC Build successful.
🟢 2025-05-19 16:56:29 UTC ydbd size 2.2 GiB changed* by -21.7 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: b2e4183 merge: 6a5f2fe diff diff %
ydbd size 2 354 365 360 Bytes 2 354 343 152 Bytes -21.7 KiB -0.001%
ydbd stripped size 494 718 792 Bytes 494 693 256 Bytes -24.9 KiB -0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@shnikd shnikd merged commit b736083 into ydb-platform:main May 19, 2025
12 checks passed

if (!schema.GetIndexes().empty()) {
for (const auto& index : schema.GetIndexes()) {
FormatUpsertIndex(fullPath, index, columns);
Copy link
Member

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()) {
Copy link
Member

Choose a reason for hiding this comment

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

это баг или действительно тут должен быть такой if?

@gridnevvvit gridnevvvit requested a review from Copilot May 19, 2025 18:58
Copy link
Contributor

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 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_create consistently.
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"}`);
Copy link

Copilot AI May 19, 2025

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.

Copilot uses AI. Check for mistakes.
nshestakov pushed a commit to nshestakov/ydb that referenced this pull request May 20, 2025
xyliganSereja pushed a commit to xyliganSereja/ydb_work that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ALTER OBJECT for SHOW CREATE TABLE with column-oriented tables

3 participants