-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added support for the List/Set type #5914
Conversation
Thanks for your help. You can add some tests for your new features according to the following articles. |
LGTM. We need to add some doc for this feature. cc. @ChrisChen2023 @abby-cyber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinks for the contirbution.
When try to execute query: | ||
""" | ||
INSERT VERTEX player(name, age, hobby, ids, score) VALUES "player100":( | ||
"Tim Duncan", 42, ["Basketball", "Swimming"], [100, 528], [50.0, 22.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there testcase cover some corner cases, e.g.
- empty list/set, insert or update.
- Fire some error conditions: for example:
- type mismatched, insert List[?] to Set[?] , or insert List[int] to List[string] etc.
- invoke new added function with wrong type, e.g. add string to List[int] etc.
- what happends if try to create index on list/set column?
- very large list/set, according to your implementation, there is seem no limit (or more accurate max of int32) on the size of list or set, right? Should we support that large size list/set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I have added test cases: Insert and update empty list/set
- If the inserted data type is inconsistent, an error will be reported: Storage Error: The data type does not meet the requirements. Use the correct type of data.
I also restricted the creation of list/set indexes and added test cases. - I have added a restriction on the array length
}; | ||
} | ||
{ | ||
auto &attr = functions_["sadd"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like sadd is short for set add, maybe setadd is more readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I have modified it :setadd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For one-dimensional data of type List/Set:
List_string, List_int, List_float,
Set_string, Set_int, Set_float:
Support attributes defined as List /Set data types.
Use the List /Set data type for storage.
The List /Set data type can be filtered during query.
Attributes of the List /Set data type can be returned when the query is supported.
Added UPDATE statement to modify (REPLACE) and remove (ERASE) specified elements in List/Set types.
Added UPDATE statement to insert new data into List/Set: List = List + value, Set = SADD(Set, value).