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

Implement union functions #1675

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Implement union functions #1675

merged 1 commit into from
Jun 14, 2023

Conversation

acquamarin
Copy link
Collaborator

@acquamarin acquamarin commented Jun 13, 2023

This PR is the first set of PRs to implement UNION datatype in kuzu.
KUZU stores UNION as a struct where the first field is the tag field indicating the selected member. Similar to C++ union, Only one member can be selected at a time.
It introduces 3 basic union functions:

  1. UNION_VALUE: creates a single member UNION containing the argument value. The tag of the value will be the bound variable name.
  2. UNION_TAG: returns the selected member name.
  3. UNION_EXTRACT: extracts a union field. If the field is not selected, NULL will be returned.

@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Patch coverage: 90.86% and project coverage change: -0.03 ⚠️

Comparison is base (904c585) 91.44% compared to head (d4dfe64) 91.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1675      +/-   ##
==========================================
- Coverage   91.44%   91.42%   -0.03%     
==========================================
  Files         730      732       +2     
  Lines       26475    26575     +100     
==========================================
+ Hits        24211    24295      +84     
- Misses       2264     2280      +16     
Impacted Files Coverage Δ
src/common/types/types.cpp 88.76% <0.00%> (-2.51%) ⬇️
src/include/common/types/value.h 100.00% <ø> (ø)
src/include/common/vector/auxiliary_buffer.h 90.90% <ø> (ø)
src/include/function/binary_operation_executor.h 75.42% <ø> (ø)
src/include/function/built_in_vector_operations.h 100.00% <ø> (ø)
.../include/function/schema/vector_label_operations.h 100.00% <ø> (ø)
...include/function/struct/vector_struct_operations.h 100.00% <ø> (ø)
src/include/function/ternary_operation_executor.h 31.72% <ø> (ø)
src/include/function/unary_operation_executor.h 86.48% <ø> (ø)
src/include/parser/transformer.h 100.00% <ø> (ø)
... and 15 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/antlr4/Cypher.g4 Outdated Show resolved Hide resolved
src/common/types/value.cpp Outdated Show resolved Hide resolved
src/expression_evaluator/base_evaluator.cpp Show resolved Hide resolved
src/common/types/value.cpp Outdated Show resolved Hide resolved
src/function/vector_union_operations.cpp Outdated Show resolved Hide resolved
src/include/common/types/types.h Show resolved Hide resolved
src/include/common/types/types.h Show resolved Hide resolved
src/include/common/types/types.h Outdated Show resolved Hide resolved
@acquamarin acquamarin merged commit 250f2a1 into master Jun 14, 2023
8 checks passed
@acquamarin acquamarin deleted the union-datatype branch June 14, 2023 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants