Skip to content

Commit

Permalink
[doc](create table) add since version for some new features (apache#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
zhannngchen authored Feb 22, 2024
1 parent a6f0a46 commit bd78243
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Column definition list:
BITMAP_UNION: The aggregation mode of BIMTAP type columns, which performs the union aggregation of bitmaps.
```
* `AUTO_INCREMENT(auto_inc_start_value)`(Available from version 2.1 and later.)
* <version since="2.1" type="inline">`AUTO_INCREMENT(auto_inc_start_value)`</version>
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.
Expand Down Expand Up @@ -143,7 +143,7 @@ Column definition list:
dt DATETIME DEFAULT CURRENT_TIMESTAMP
```
* `on update current_timestamp`
* <version since="2.1" type="inline">`on update current_timestamp`</version>
To indicate that whether the value of this column should be updated to the current timestamp (`current_timestamp`) when there is an update on the row. The feature is only available on unique table with merge-on-write enabled. Columns with this feature enabled must declare a default value, and the default value must be `current_timestamp`. If the precision of the timestamp is declared here, the timestamp precision in the default value of the column must be the same as the precision declared here."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ distribution_desc
HLL_UNION:HLL 类型的列的聚合方式,通过 HyperLogLog 算法聚合。
BITMAP_UNION:BIMTAP 类型的列的聚合方式,进行位图的并集聚合。
```
* `AUTO_INCREMENT(auto_inc_start_value)`(2.1版本及以后可用)
* <version since="2.1" type="inline">`AUTO_INCREMENT(auto_inc_start_value)`</version>

是否为自增列,自增列可以用来为新插入的行生成一个唯一标识。在插入表数据时如果没有指定自增列的值,则会自动生成一个合法的值。当自增列被显示地插入NULL时,其值也会被替换为生成的合法值。需要注意的是,处于性能考虑,BE会在内存中缓存部分自增列的值,所以自增列自动生成的值只能保证单调性和唯一性,无法保证严格的连续性。
一张表中至多有一个列是自增列,自增列必须是BIGINT类型,且必须为NOT NULL。
Expand All @@ -130,7 +130,7 @@ distribution_desc
// 只用于DATETIME类型,导入数据缺失该值时系统将赋予当前时间
dt DATETIME DEFAULT CURRENT_TIMESTAMP
```
* `on update current_timestamp`
* <version since="2.1" type="inline">`on update current_timestamp`</version>

是否在该行有列更新时将该列的值更新为当前时间(`current_timestamp`)。该特性只能在开启了merge-on-write的unique表上使用,开启了这个特性的列必须声明默认值,且默认值必须为`current_timestamp`。如果此处声明了时间戳的精度,则该列默认值中的时间戳精度必须与该处的时间戳精度相同。

Expand Down

0 comments on commit bd78243

Please sign in to comment.