Skip to content

Commit

Permalink
Update 3.alter-tag.md (#2676)
Browse files Browse the repository at this point in the history
  • Loading branch information
abby-cyber authored Mar 23, 2023
1 parent 78cb72d commit 61cced1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- 确保新增的属性名不与已存在或被删除的属性名同名,否则新增属性会失败。

- 允许增加`FIXED_STRING``INT`类型的长度。
- 允许`FIXED_STRING`类型转换为`STRING`类型、`FLOAT`类型转换为`DOUBLE`类型。
- 仅允许**增加**`FIXED_STRING``INT`类型的长度,不允许减少长度
- 仅允许转换`FIXED_STRING`类型为`STRING`类型、转换`FLOAT`类型为`DOUBLE`类型。

## 语法

Expand Down Expand Up @@ -40,13 +40,12 @@ ttl_definition:

```ngql
nebula> CREATE TAG IF NOT EXISTS t1 (p1 string, p2 int);
nebula> ALTER TAG t1 ADD (p3 int, p4 string);
nebula> ALTER TAG t1 ADD (p3 int32, p4 fixed_string(10));
nebula> ALTER TAG t1 TTL_DURATION = 2, TTL_COL = "p2";
nebula> ALTER TAG t1 COMMENT = 'test1';
nebula> ALTER TAG t1 ADD (p5 double NOT NULL DEFAULT 0.4 COMMENT 'p5') COMMENT='test2';
// 修改 TAG `t1` 的 `p3` 属性为 INT8 类型
nebula> ALTER TAG t1 CHANGE (p3 int8, p4 string);
[ERROR(-1005)]: Unsupported!
// 将 TAG t1 的 p3 属性类型从 INT32 改为 INT64,p4 属性类型从 FIXED_STRING(10) 改为 STRING。
nebula> ALTER TAG t1 CHANGE (p3 int64, p4 string);
```

## 修改 Tag 说明
Expand Down

0 comments on commit 61cced1

Please sign in to comment.