Alter table drop not null#6342
Conversation
| enum class ETypeOfChange { | ||
| Nothing, | ||
| SetNullConstraint, | ||
| SetFamaly |
There was a problem hiding this comment.
In set family query calls this constructor
| ( 2, NULL, 2 ); | ||
| )sql", NYdb::NQuery::TTxControl::BeginTx().CommitTx()).ExtractValueSync(); | ||
| UNIT_ASSERT_C(initNullValues.IsSuccess(), initNullValues.GetIssues().ToString()); | ||
| } |
There was a problem hiding this comment.
я бы еще добавил тест, который может их (нулы) прочитать. записать хорошо, но еще нужно проверить что значения можно прочитать.
еще обратите пожалуйста внимание на флаг keep in cache = он должен стоять в true при выполнении запросов.
There was a problem hiding this comment.
Хорошо, добавлю
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
| } | ||
| } | ||
|
|
||
| Y_UNIT_TEST(SeveralCTAS) { |
There was a problem hiding this comment.
Something went wrong here. Maybe bad merge?
|
|
||
| Y_UNIT_TEST(AlterTable_DropNotNull_WithSetFamily_Valid) { | ||
| NKikimrConfig::TAppConfig appConfig; | ||
| appConfig.MutableTableServiceConfig()->SetEnableOlapSink(false); |
There was a problem hiding this comment.
you don't need these flags here
| break; | ||
| } | ||
| case TRule_alter_table_action::kAltAlterTableAction17: { | ||
| // ALTER COLUMN id SET (NOT NULL | NULL) |
There was a problem hiding this comment.
Yes, it will be fixed
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
| alter_table_add_column: ADD COLUMN? column_schema; | ||
| alter_table_drop_column: DROP COLUMN? an_id; | ||
| alter_table_alter_column: ALTER COLUMN an_id SET family_relation; | ||
| alter_table_alter_column_drop_not_null: ALTER COLUMN an_id DROP NOT NULL; |
There was a problem hiding this comment.
нужны тесты в v1/sql_format/ut на эту часть грамматики
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
…-local into alter-table-drop-not-null
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
@flown4qqqq добавьте описание этой фичи в документацию |
Когда-то давно (когда еще YQL жил в github) была поставлена задача - поддержать SET/DROP NOT NULL на колонку. DROP NOT NULL был сделан и давно уже существует в main: <#6342>. Однако с SET NOT NULL возникли определенные сложности, поэтому был сделан отдельный пулл реквест: <#6341>. Как видно, ПР так и не вмержили по причине увольнения автора кода. Недавно задача всплыла вновь, поэтому надо доделать. В этом пулл реквесте добавляется код в грамматику YQL новое выражение - `ALTER TABLE t ALTER COLUMN c SET NOT NULL`, которая добавляет ограничение `NOT NULL` на колонку. commit_hash:f310061b13666418c46309ea32032fbce68fb865
Когда-то давно (когда еще YQL жил в github) была поставлена задача - поддержать SET/DROP NOT NULL на колонку. DROP NOT NULL был сделан и давно уже существует в main: <ydb-platform/ydb#6342>. Однако с SET NOT NULL возникли определенные сложности, поэтому был сделан отдельный пулл реквест: <ydb-platform/ydb#6341>. Как видно, ПР так и не вмержили по причине увольнения автора кода. Недавно задача всплыла вновь, поэтому надо доделать. В этом пулл реквесте добавляется код в грамматику YQL новое выражение - `ALTER TABLE t ALTER COLUMN c SET NOT NULL`, которая добавляет ограничение `NOT NULL` на колонку. commit_hash:f310061b13666418c46309ea32032fbce68fb865
Когда-то давно (когда еще YQL жил в github) была поставлена задача - поддержать SET/DROP NOT NULL на колонку. DROP NOT NULL был сделан и давно уже существует в main: <ydb-platform/ydb#6342>. Однако с SET NOT NULL возникли определенные сложности, поэтому был сделан отдельный пулл реквест: <ydb-platform/ydb#6341>. Как видно, ПР так и не вмержили по причине увольнения автора кода. Недавно задача всплыла вновь, поэтому надо доделать. В этом пулл реквесте добавляется код в грамматику YQL новое выражение - `ALTER TABLE t ALTER COLUMN c SET NOT NULL`, которая добавляет ограничение `NOT NULL` на колонку. commit_hash:f310061b13666418c46309ea32032fbce68fb865
Changelog entry
Adding query 'ALTER TABLE table ALTER COLUMN column DROP NOT NULL'
Changelog category
New feature
Additional information
'ALTER TABLE table ALTER COLUMN column SET NOT NULL' in other PR (#6341)