This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 7840e7cb819ab695cf4a32f29c8fe13a586529c1 Author: yuanyuan8983 <[email protected]> AuthorDate: Mon Feb 5 15:36:51 2024 +0800 [typo](doc) modify format (#30816) --- .../Alter/ALTER-TABLE-COLUMN.md | 28 ++++++++++++---------- .../Alter/ALTER-TABLE-COLUMN.md | 28 ++++++++++++---------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md index 1276ccddbfa..7897540a60d 100644 --- a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md +++ b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md @@ -34,7 +34,7 @@ This statement is used to perform a schema change operation on an existing table Doris has the concept of materialized index after table construction. After successful table construction, it is the base table and the materialized index is the base index. rollup index can be created based on the base table. Both base index and rollup index are materialized indexes. If rollup_index_name is not specified during the schema change operation, the operation is based on the base table by default. -:::note +:::tip Doris 1.2.0 supports light schema change for light scale structure changes, and addition and subtraction operations for value columns can be completed more quickly and synchronously. You can manually specify "light_schema_change" = 'true' when creating a table. This parameter is enabled by default for versions 2.0.0 and later. ::: @@ -94,10 +94,11 @@ ALTER TABLE [database.]table table_name ADD COLUMN column_name column_type [KEY ADD COLUMN new_col INT KEY DEFAULT "0" FIRST; ``` -:::note +:::tip - If you add a value column to the aggregation model, you need to specify agg_type - For non-aggregated models (such as DUPLICATE KEY), if you add a key column, you need to specify the KEY keyword -- You cannot add columns that already exist in the base index to the rollup index (you can recreate a rollup index if necessary) ::: +- You cannot add columns that already exist in the base index to the rollup index (you can recreate a rollup index if necessary) +::: **2. Add multiple columns to the specified index** @@ -127,10 +128,11 @@ ALTER TABLE [database.]table table_name ADD COLUMN (column_name1 column_type [KE ADD COLUMN (new_col1 INT key DEFAULT "0" , new_col2 INT DEFAULT "0"); ``` -:::note +:::tip - If you add a value column to the aggregation model, you need to specify agg_type - If you add a key column to the aggregation model, you need to specify the KEY keyword - - You cannot add columns that already exist in the base index to the rollup index (you can recreate a rollup index if necessary) ::: + - You cannot add columns that already exist in the base index to the rollup index (you can recreate a rollup index if necessary) +::: **3. Delete a column from the specified index** @@ -149,10 +151,11 @@ ALTER TABLE [database.]table table_name ADD COLUMN (column_name1 column_type [KE ALTER TABLE example_db.my_table DROP COLUMN col1; ``` -:::note +:::tip - Cannot drop partition column - The aggregate model cannot delete KEY columns - - If the column is removed from the base index, it will also be removed if it is included in the rollup index ::: + - If the column is removed from the base index, it will also be removed if it is included in the rollup index +::: **4. Modify the column type and column position of the specified index** @@ -174,7 +177,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN col1 BIGINT KEY DEFAULT "1" AFTER col2; ``` - :::note + :::tip Whether you modify the key column or the value column, you need to declare complete column information ::: @@ -185,7 +188,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc"; ``` - :::note + :::tip You can only modify the column's data type; other attributes of the column must remain unchanged. ::: @@ -196,7 +199,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN k3 VARCHAR(50) KEY NULL COMMENT 'to 50'; ``` -:::note +:::tip - If you modify the value column in the aggregation model, you need to specify agg_type - If you modify the key column for non-aggregate types, you need to specify the KEY keyword - Only the type of the column can be modified, and other attributes of the column remain as they are (that is, other attributes need to be explicitly written in the statement according to the original attributes, see example 8) @@ -211,7 +214,8 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K - DATE is converted to DATETIME (hours, minutes and seconds are automatically filled with zeros, for example: `2019-12-09` <--> `2019-12-09 00:00:00`) - Convert FLOAT to DOUBLE - INT is converted to DATE (if the INT type data is illegal, the conversion fails, and the original data remains unchanged) - - All can be converted to STRING except DATE and DATETIME, but STRING cannot be converted to any other type ::: + - All can be converted to STRING except DATE and DATETIME, but STRING cannot be converted to any other type +::: **5. Reorder the column at the specified index** @@ -290,7 +294,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K +-------+------------+------+-------+---------+-------+ ``` -:::note +:::tip - All columns in index are written out - the value column comes after the key column - You can adjust the key column only within the range of the key column. The same applies to the value column diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md index db43a0ac8fb..d372e24e9bc 100644 --- a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md +++ b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-COLUMN.md @@ -32,7 +32,7 @@ ALTER TABLE COLUMN 该语句用于对已有 table 进行 Schema change 操作。schema change 是异步的,任务提交成功则返回,之后可使用[SHOW ALTER TABLE COLUMN](../../Show-Statements/SHOW-ALTER.md) 命令查看进度。 -:::note +:::tip Doris 在建表之后有物化索引的概念,在建表成功后为 base 表,物化索引为 base index,基于 base 表可以创建 rollup index。其中 base index 和 rollup index 都是物化索引,在进行 schema change 操作时如果不指定 rollup_index_name 默认基于 base 表进行操作。 Doris 在 1.2.0 支持了 light schema change 轻量表结构变更,对于值列的加减操作,可以更快地,同步地完成。可以在建表时手动指定 "light_schema_change" = 'true',2.0.0 及之后版本该参数默认开启。 ::: @@ -93,10 +93,11 @@ ALTER TABLE [database.]table table_name ADD COLUMN column_name column_type [KEY ADD COLUMN new_col INT KEY DEFAULT "0" FIRST; ``` - :::note +:::tip - 聚合模型如果增加 value 列,需要指定 agg_type - 非聚合模型(如 DUPLICATE KEY)如果增加key列,需要指定KEY关键字 - - 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index)::: + - 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index) +::: **2. 添加多列,向指定的 index 位置进行多列添加** @@ -124,11 +125,12 @@ ALTER TABLE [database.]table table_name ADD COLUMN column_name column_type [KEY ADD COLUMN (new_col1 INT key DEFAULT "0" , new_col2 INT DEFAULT "0"); ``` -:::note +:::tip - 聚合模型如果增加 value 列,需要指定agg_type - 聚合模型如果增加key列,需要指定KEY关键字 - - 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index)::: + - 不能在 rollup index 中增加 base index 中已经存在的列(如有需要,可以重新创建一个 rollup index) +::: **3. 删除列,从指定 index 中删除一列** @@ -147,10 +149,11 @@ ALTER TABLE [database.]table table_name ADD COLUMN column_name column_type [KEY ALTER TABLE example_db.my_table DROP COLUMN col1; ``` -:::note +:::tip - 不能删除分区列 - 聚合模型不能删除KEY列 - - 如果是从 base index 中删除列,则如果 rollup index 中包含该列,也会被删除 ::: + - 如果是从 base index 中删除列,则如果 rollup index 中包含该列,也会被删除 +::: **4. 修改指定列类型以及列位置** @@ -172,7 +175,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN col1 BIGINT KEY DEFAULT "1" AFTER col2; ``` - :::note + :::tip 无论是修改 key 列还是 value 列都需要声明完整的 column 信息 ::: @@ -183,7 +186,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN val1 VARCHAR(64) REPLACE DEFAULT "abc"; ``` - :::note + :::tip 只能修改列的类型,列的其他属性维持原样 ::: @@ -194,7 +197,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K MODIFY COLUMN k3 VARCHAR(50) KEY NULL COMMENT 'to 50'; ``` - :::note +:::tip - 聚合模型如果修改 value 列,需要指定 agg_type - 非聚合类型如果修改key列,需要指定KEY关键字 - 只能修改列的类型,列的其他属性维持原样(即其他属性需在语句中按照原属性显式的写出,参见 example 8) @@ -209,7 +212,8 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K - DATE 转换成 DATETIME(时分秒自动补零, 例如: `2019-12-09` <--> `2019-12-09 00:00:00`) - FLOAT 转换成 DOUBLE - INT 转换成 DATE (如果INT类型数据不合法则转换失败,原始数据不变) - - 除DATE与DATETIME以外都可以转换成STRING,但是STRING不能转换任何其他类型 ::: + - 除DATE与DATETIME以外都可以转换成STRING,但是STRING不能转换任何其他类型 +::: **5. 对指定表的列进行重新排序** @@ -288,7 +292,7 @@ ALTER TABLE [database.]table table_name MODIFY COLUMN column_name column_type [K +-------+------------+------+-------+---------+-------+ ``` -:::note +:::tip - index 中的所有列都要写出来 - value 列在 key 列之后 - key 列只能调整 key 列的范围内进行调整,value 列同理 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
