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

Added support for the List/Set type #5914

Merged
merged 36 commits into from
Oct 25, 2024
Merged

Conversation

YZW00
Copy link
Contributor

@YZW00 YZW00 commented Jul 31, 2024

For one-dimensional data of type List/Set:
List_string, List_int, List_float,
Set_string, Set_int, Set_float:

  1. Support attributes defined as List /Set data types.

  2. Use the List /Set data type for storage.

  3. The List /Set data type can be filtered during query.

  4. Attributes of the List /Set data type can be returned when the query is supported.

  5. Added UPDATE statement to modify (REPLACE) and remove (ERASE) specified elements in List/Set types.

  6. Added UPDATE statement to insert new data into List/Set: List = List + value, Set = SADD(Set, value).

@YZW00 YZW00 requested review from dutor, codesigner and a team as code owners July 31, 2024 14:55
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2024

CLA assistant check
All committers have signed the CLA.

share/resources/gflags.json Outdated Show resolved Hide resolved
share/resources/date_time_zonespec.csv Outdated Show resolved Hide resolved
src/codec/RowReaderV2.cpp Outdated Show resolved Hide resolved
src/codec/RowReaderV2.cpp Outdated Show resolved Hide resolved
src/codec/RowReaderV2.cpp Outdated Show resolved Hide resolved
src/codec/RowWriterV2.cpp Outdated Show resolved Hide resolved
src/common/datatypes/List.h Outdated Show resolved Hide resolved
src/meta/processors/schema/SchemaUtil.cpp Outdated Show resolved Hide resolved
src/codec/RowReaderV2.cpp Outdated Show resolved Hide resolved
src/codec/RowWriterV2.cpp Outdated Show resolved Hide resolved
@codesigner codesigner requested a review from Salieri-004 August 7, 2024 06:25
@Salieri-004
Copy link
Contributor

Thanks for your help. You can add some tests for your new features according to the following articles.
https://discuss.nebula-graph.com.cn/t/topic/4172
https://discuss.nebula-graph.com.cn/t/topic/4594

@Salieri-004 Salieri-004 added ready-for-testing PR: ready for the CI test ready for review labels Aug 22, 2024
@Salieri-004 Salieri-004 removed the ready-for-testing PR: ready for the CI test label Aug 30, 2024
src/codec/RowWriterV2.h Show resolved Hide resolved
src/codec/RowWriterV2.cpp Outdated Show resolved Hide resolved
src/codec/RowWriterV2.cpp Outdated Show resolved Hide resolved
src/common/function/FunctionManager.cpp Outdated Show resolved Hide resolved
src/common/function/FunctionManager.cpp Outdated Show resolved Hide resolved
src/common/meta/NebulaSchemaProvider.cpp Outdated Show resolved Hide resolved
src/common/meta/NebulaSchemaProvider.cpp Outdated Show resolved Hide resolved
src/graph/executor/algo/AllPathsExecutor.cpp Show resolved Hide resolved
src/codec/RowWriterV2.cpp Outdated Show resolved Hide resolved
src/common/function/FunctionManager.cpp Outdated Show resolved Hide resolved
src/common/function/FunctionManager.cpp Outdated Show resolved Hide resolved
src/common/function/FunctionManager.cpp Outdated Show resolved Hide resolved
@Salieri-004 Salieri-004 added the doc affected PR: improvements or additions to documentation label Oct 16, 2024
@Salieri-004
Copy link
Contributor

LGTM. We need to add some doc for this feature. cc. @ChrisChen2023 @abby-cyber

Salieri-004
Salieri-004 previously approved these changes Oct 16, 2024
Copy link
Contributor

@codesigner codesigner left a 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]
Copy link
Contributor

@codesigner codesigner Oct 16, 2024

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.

  1. empty list/set, insert or update.
  2. 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?
  3. 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I have added test cases: Insert and update empty list/set
  2. 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.
  3. I have added a restriction on the array length

};
}
{
auto &attr = functions_["sadd"];
Copy link
Contributor

@codesigner codesigner Oct 16, 2024

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?

Copy link
Contributor Author

@YZW00 YZW00 Oct 24, 2024

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

flymysql

This comment was marked as resolved.

Copy link
Contributor

@flymysql flymysql left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codesigner codesigner merged commit 6c09e83 into vesoft-inc:master Oct 25, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants