KassieZ commented on code in PR #1240: URL: https://github.com/apache/doris-website/pull/1240#discussion_r1820428913
########## docs/table-design/schema-change.md: ########## @@ -97,31 +97,71 @@ ALTER TABLE table_name ADD COLUMN column_name column_type [KEY | agg_type] [DEFA ### Examples -**1. Adding a key column `new_col` (non-aggregate model) after col1 to `example_rollup_index`** +#### non-aggregate model Review Comment: `**Non-aggregate Model**` ########## docs/table-design/schema-change.md: ########## @@ -97,31 +97,71 @@ ALTER TABLE table_name ADD COLUMN column_name column_type [KEY | agg_type] [DEFA ### Examples -**1. Adding a key column `new_col` (non-aggregate model) after col1 to `example_rollup_index`** +#### non-aggregate model + +table's DDL: +```sql +CREATE TABLE IF NOT EXISTS example_db.my_table( + col1 int, + col2 int, + col3 int, + col4 int, + col5 int +) DUPLICATE KEY(col1, col2, col3) +DISTRIBUTED BY RANDOM BUCKETS 1 +ROLLUP ( + example_rollup_index (col1, col3, col4, col5) +) +PROPERTIES ( + "replication_num" = "1" +) +``` + +**1. Adding a key column `new_col` after col1 to `example_rollup_index`** ```sql ALTER TABLE example_db.my_table ADD COLUMN new_col INT KEY DEFAULT "0" AFTER col1 TO example_rollup_index; ``` -**2. Adding a value column `new_col` (non-aggregate model) with a default value of 0 after col1 to `example_rollup_index`** +**2. Adding a value column `new_col` with a default value of 0 after col1 to `example_rollup_index`** ```sql ALTER TABLE example_db.my_table ADD COLUMN new_col INT DEFAULT "0" AFTER col1 TO example_rollup_index; ``` -**3. Adding a Key column `new_col` (aggregate model) after col1 to `example_rollup_index`** +#### aggregate model Review Comment: `**Aggregate Model**` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org