From e19eec51f83227f34d81b06e42f0a5042dbf2915 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 23 Mar 2023 12:00:30 +0800 Subject: [PATCH 1/2] Update 3.alter-tag.md --- docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md b/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md index 77d766e9e34..bebd209025c 100644 --- a/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md +++ b/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md @@ -10,7 +10,7 @@ - The property name must be unique in a tag. If you add a property with the same name as an existing property or a dropped property, the operation fails. -- Only the length of a `FIXED_STRING` or an `INT` can be increased. +- Only the length of a `FIXED_STRING` or an `INT` can be increased. The length of a `STRING` or an `INT` cannot be decreased. - Only the data type conversions from FIXED_STRING to STRING and from FLOAT to DOUBLE are allowed. @@ -42,12 +42,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, 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'; -// Change the `p3` property to INT8 -nebula> ALTER TAG t1 CHANGE (p3 int8, p4 string); +// Change the data type of p3 in the TAG t1 from INT32 to INT64, and that of p4 from FIXED_STRING(10) to STRING. +nebula> ALTER TAG t1 CHANGE (p3 int64, p4 string); [ERROR(-1005)]: Unsupported! ``` From 8eb7363e3b7f94d0805a0624fa010192e3b00c64 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:12:53 +0800 Subject: [PATCH 2/2] Update 3.alter-tag.md --- docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md b/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md index bebd209025c..ba5d79eec2b 100644 --- a/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md +++ b/docs-2.0/3.ngql-guide/10.tag-statements/3.alter-tag.md @@ -10,10 +10,6 @@ - The property name must be unique in a tag. If you add a property with the same name as an existing property or a dropped property, the operation fails. -- Only the length of a `FIXED_STRING` or an `INT` can be increased. The length of a `STRING` or an `INT` cannot be decreased. - -- Only the data type conversions from FIXED_STRING to STRING and from FLOAT to DOUBLE are allowed. - ## Syntax @@ -38,6 +34,12 @@ ttl_definition: - When a property value is set to `NOT NULL` using `ADD` or `CHANGE`, a default value must be specified for the property, that is, the value of `DEFAULT` must be specified. +- When using `CHANGE` to modify the data type of a property: + + - Only the length of a `FIXED_STRING` or an `INT` can be increased. The length of a `STRING` or an `INT` cannot be decreased. + + - Only the data type conversions from FIXED_STRING to STRING and from FLOAT to DOUBLE are allowed. + ## Examples ```ngql