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

Add ser/deser for macro function #1846

Merged
merged 1 commit into from
Jul 23, 2023
Merged

Add ser/deser for macro function #1846

merged 1 commit into from
Jul 23, 2023

Conversation

acquamarin
Copy link
Collaborator

@acquamarin acquamarin commented Jul 21, 2023

Added serialization/deserialization for macro functions. Instead of using the template serializeValue<> and deserializeValue<> functions to serialize classes, classes should implement their own serialization/deserialization methods. Another refactor on the ser/deser APIs needs to be done.

TODOs

@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Patch coverage: 83.15% and project coverage change: -0.07 ⚠️

Comparison is base (fac6192) 91.29% compared to head (1be05cf) 91.23%.

❗ Current head 1be05cf differs from pull request most recent head eab2e25. Consider uploading reports for the commit eab2e25 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1846      +/-   ##
==========================================
- Coverage   91.29%   91.23%   -0.07%     
==========================================
  Files         792      796       +4     
  Lines       28762    28951     +189     
==========================================
+ Hits        26259    26412     +153     
- Misses       2503     2539      +36     
Impacted Files Coverage Δ
src/include/catalog/catalog.h 100.00% <ø> (ø)
src/include/common/types/value.h 100.00% <ø> (ø)
src/include/function/scalar_macro_function.h 100.00% <ø> (ø)
...de/parser/expression/parsed_parameter_expression.h 33.33% <0.00%> (-26.67%) ⬇️
...ude/parser/expression/parsed_subquery_expression.h 40.00% <0.00%> (-26.67%) ⬇️
src/storage/store/rels_statistics.cpp 100.00% <ø> (ø)
src/storage/store/table_statistics.cpp 100.00% <ø> (ø)
src/include/parser/expression/parsed_expression.h 76.47% <33.33%> (-9.25%) ⬇️
src/common/types/value.cpp 80.41% <44.68%> (-3.34%) ⬇️
src/function/scalar_macro_function.cpp 88.88% <83.33%> (-11.12%) ⬇️
... and 18 more

... and 2 files 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.

@acquamarin acquamarin requested a review from ray6080 July 23, 2023 13:36
src/common/arrow/arrow_row_batch.cpp Show resolved Hide resolved
src/catalog/catalog.cpp Outdated Show resolved Hide resolved
offset = SerDeser::deserializeValue<std::string>(value.name, fileInfo, offset);
offset = SerDeser::deserializeValue<LogicalType>(value.dataType, fileInfo, offset);
offset = SerDeser::deserializeValue<property_id_t>(value.propertyID, fileInfo, offset);
void SerDeser::deserializeValue<Property>(Property& value, FileInfo* fileInfo, uint64_t& offset) {
Copy link
Contributor

@ray6080 ray6080 Jul 23, 2023

Choose a reason for hiding this comment

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

Why is it necessary to change deserializeValue to taking a reference of offset here? My guess is for simplicity?

I think both serializeValue and deserializeValue should be consistent. If you are changing deserializeValue, make sure you change serializeValue too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because the serailizeValue function will return a unique_ptr when deserializing the parsedExpression.

src/function/scalar_macro_function.cpp Outdated Show resolved Hide resolved
@acquamarin acquamarin merged commit d6abf42 into master Jul 23, 2023
10 checks passed
@acquamarin acquamarin deleted the parsed-expr-serialize branch July 23, 2023 17:52
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