Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alter schema change property to a different type (string->int) #2873

Closed
Sophie-Xie opened this issue Sep 15, 2021 · 3 comments
Closed

alter schema change property to a different type (string->int) #2873

Sophie-Xie opened this issue Sep 15, 2021 · 3 comments
Assignees
Labels
type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Milestone

Comments

@Sophie-Xie
Copy link
Contributor

Prepare the space

(root@nebula) [(none)]> create space test1(vid_type=fixed_string(30))
Execution succeeded (time spent 39512/41812 us)

Tue, 14 Sep 2021 10:27:53 CST

(root@nebula) [(none)]> use test1
[ERROR (-1005)]: SpaceNotFound:

Tue, 14 Sep 2021 10:27:56 CST

(root@nebula) [(none)]> use test1
Execution succeeded (time spent 48813/51626 us)

Tue, 14 Sep 2021 10:27:58 CST
(root@nebula) [test1]> create tag test(col1 string , col2 string);
Execution succeeded (time spent 83144/85189 us)

Tue, 14 Sep 2021 10:38:20 CST

(root@nebula) [test1]> insert vertex test(col1,col2) values "11":("aa","bb");
Execution succeeded (time spent 6843/9300 us)

Tue, 14 Sep 2021 10:38:42 CST

(root@nebula) [test1]> fetch prop on test "11"
+--------------------------------------+
| vertices_                            |
+--------------------------------------+
| ("11" :test{col1: "aa", col2: "bb"}) |
+--------------------------------------+
Got 1 rows (time spent 11830/14468 us)

Tue, 14 Sep 2021 10:38:58 CST

(root@nebula) [test1]> alter tag test change (col2 int)
Execution succeeded (time spent 40178/44064 us)

Tue, 14 Sep 2021 10:41:12 CST

(root@nebula) [test1]> fetch prop on test "11"
+--------------------------------------+
| vertices_                            |
+--------------------------------------+
| ("11" :test{col1: "aa", col2: "bb"}) |
+--------------------------------------+
Got 1 rows (time spent 9940/13559 us)

Tue, 14 Sep 2021 10:41:18 CST

(root@nebula) [test1]> insert vertex test(col1,col2) values "22":("aa",99)
Execution succeeded (time spent 15569/18790 us)

Tue, 14 Sep 2021 10:42:04 CST

(root@nebula) [test1]> create tag index test_index on test(col2);
Execution succeeded (time spent 68325/71791 us)

Tue, 14 Sep 2021 10:42:08 CST

(root@nebula) [test1]> rebuild tag index test_index
+------------+
| New Job Id |
+------------+
| 30         |
+------------+
Got 1 rows (time spent 61606/66416 us)

Tue, 14 Sep 2021 10:42:13 CST

(root@nebula) [test1]> show jobs
+--------+---------------------+------------+-------------------------+-------------------------+
| Job Id | Command             | Status     | Start Time              | Stop Time               |
+--------+---------------------+------------+-------------------------+-------------------------+
| 30     | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-09-14T02:42:13.000 | 2021-09-14T02:42:13.000 |
+--------+---------------------+------------+-------------------------+-------------------------+
Got 1 rows (time spent 17940/20785 us)

Tue, 14 Sep 2021 10:42:17 CST

(root@nebula) [test1]> lookup on test where test.col2 < 99 yield test.col2;
+----------+----------------------+
| VertexID | test.col2            |
+----------+----------------------+
| "11"     | -2134143272594898944 |
+----------+----------------------+
Got 1 rows (time spent 13113/16100 us)

Tue, 14 Sep 2021 10:42:34 CST

from #2671

@Sophie-Xie Sophie-Xie added the type/bug Type: something is unexpected label Sep 15, 2021
@Sophie-Xie Sophie-Xie added this to the v2.6.0 milestone Sep 15, 2021
@Sophie-Xie Sophie-Xie modified the milestones: v2.6.0, v2.7.0 Sep 18, 2021
@Sophie-Xie
Copy link
Contributor Author

There are other high priority issues to do, this issue will be later to next version.

@Sophie-Xie Sophie-Xie modified the milestones: v2.7.0, v3.0.0 Oct 15, 2021
@Sophie-Xie Sophie-Xie added type/feature req Type: feature request type/bug Type: something is unexpected and removed type/bug Type: something is unexpected type/feature req Type: feature request labels Oct 18, 2021
@critical27
Copy link
Contributor

critical27 commented Nov 16, 2021

IMO, when add/change, we require default value or nullable of the added/changed field. As for drop, we'd better just forbid it, drop will raise up more problem.

There is a related problem fo rebuild index https://discuss.nebula-graph.com.cn/t/topic/6376/

@critical27 critical27 modified the milestones: v3.0.0, v3.1.0 Nov 25, 2021
@Sophie-Xie Sophie-Xie modified the milestones: v3.1.0, v4.0.0 Jan 7, 2022
@Sophie-Xie
Copy link
Contributor Author

Talked it offline, all schema problem will fixed in 5.x.

@Sophie-Xie Sophie-Xie added the wontfix Solution: this will not be worked on recently label Apr 28, 2022
yixinglu pushed a commit to yixinglu/nebula that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Projects
None yet
Development

No branches or pull requests

3 participants