Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Jul 20, 2023
1 parent 12e7352 commit 0b56fe4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ Column definition list:

* `AUTO_INCREMENT`(only avaliable in master branch)

To indicate if the column is a auto-increment column. Auto-increment column can be used to generate a unique identity for new row. If no values are assgined for auto-increment column when inserting, Doris will generate sequence numbers automatically. You can also assign the auto-increment column with NULL literal to indicate Doris to generate sequence numbers. It should be noted that, for performance reasons, BE will cache some values of auto-increment columns in memory. Therefore, the values generated by auto-increment columns can only guarantee monotonicity and uniqueness, but not strict continuity.
To indicate if the column is a auto-increment column. Auto-increment column can be used to generate a unique identity for new row. If no values are assgined for auto-increment column when inserting, Doris will generate sequence numbers automatically. You can also assign the auto-increment column with NULL literal to indicate Doris to generate sequence numbers. It should be noted that, for performance reasons, BE will cache some values of auto-increment column in memory. Therefore, the values generated by auto-increment column can only guarantee monotonicity and uniqueness, but not strict continuity.
A table can have at most one auto-incremnt column. The auto-increment column should be BIGINT type and be NOT NULL.
Currently, only table of duplicate model supports auto-increment column.
Both Duplicate model table and Unique model table support auto-increment column

* `default_value`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ distribution_desc

是否为自增列,自增列可以用来为新插入的行生成一个唯一标识。在插入表数据时如果没有指定自增列的值,则会自动生成一个合法的值。当自增列被显示地插入NULL时,其值也会被替换为生成的合法值。需要注意的是,处于性能考虑,BE会在内存中缓存部分自增列的值,所以自增列自动生成的值只能保证单调性和唯一性,无法保证严格的连续性。
一张表中至多有一个列是自增列,自增列必须是BIGINT类型,且必须为NOT NULL。
目前只有duplicate模型支持自增列
Duplicate模型表和Unique模型表均支持自增列

* `default_value`
列默认值,当导入数据未指定该列的值时,系统将赋予该列default_value。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,4 @@ suite("test_unique_table") {
order_qt_select_uniq_table "select * from ${tbName}"
qt_desc_uniq_table "desc ${tbName}"
sql "DROP TABLE ${tbName}"

def table_auto_inc = "test_aggregate_tab_with_auto_inc_col"
sql "drop table if exists ${table_auto_inc}"
test {
sql """
CREATE TABLE IF NOT EXISTS ${table_auto_inc} (
k BIGINT NOT NULL AUTO_INCREMENT,
int_value int,
char_value char(10),
date_value date
)
UNIQUE KEY(k)
DISTRIBUTED BY HASH(k) BUCKETS 5 properties("replication_num" = "1");
"""
exception "the auto increment is only supported in duplicate table."
}
}

0 comments on commit 0b56fe4

Please sign in to comment.