Skip to content

refactor(connector): avoid using macro in parser #10120

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

Merged
merged 3 commits into from
Jun 6, 2023

Conversation

BugenZhao
Copy link
Member

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR replaces the original macro-based code reuse with the default implementation of the method in the trait, which can be much more friendly to developing and maintaining (for example, code navigation and auto-completion).

Also eliminate some unnecessary Box<dyn>.

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

BugenZhao added 2 commits June 1, 2023 16:44
Signed-off-by: Bugen Zhao <[email protected]>
@github-actions github-actions bot added the type/refactor Type: Refactoring. label Jun 1, 2023
@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #10120 (ad69718) into main (572780b) will decrease coverage by 0.04%.
The diff coverage is 2.75%.

@@            Coverage Diff             @@
##             main   #10120      +/-   ##
==========================================
- Coverage   70.79%   70.76%   -0.04%     
==========================================
  Files        1235     1235              
  Lines      211451   211557     +106     
==========================================
  Hits       149698   149698              
- Misses      61753    61859     +106     
Flag Coverage Δ
rust 70.76% <2.75%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/connector/src/lib.rs 81.25% <ø> (ø)
src/connector/src/macros.rs 69.01% <ø> (+4.54%) ⬆️
src/connector/src/parser/avro/parser.rs 58.93% <0.00%> (-1.43%) ⬇️
src/connector/src/parser/canal/simd_json_parser.rs 79.55% <0.00%> (-3.12%) ⬇️
src/connector/src/parser/csv_parser.rs 87.09% <0.00%> (-3.92%) ⬇️
src/connector/src/parser/debezium/avro_parser.rs 37.27% <0.00%> (-1.41%) ⬇️
...connector/src/parser/debezium/mongo_json_parser.rs 60.21% <0.00%> (-2.71%) ⬇️
.../connector/src/parser/debezium/simd_json_parser.rs 92.15% <0.00%> (-1.53%) ⬇️
src/connector/src/parser/json_parser.rs 93.35% <0.00%> (-3.21%) ⬇️
...c/connector/src/parser/maxwell/simd_json_parser.rs 76.92% <0.00%> (-5.43%) ⬇️
... and 5 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@waruto210 waruto210 left a comment

Choose a reason for hiding this comment

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

LGTM.

@BugenZhao BugenZhao added this pull request to the merge queue Jun 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2023
@BugenZhao BugenZhao enabled auto-merge June 6, 2023 16:34
@BugenZhao BugenZhao added this pull request to the merge queue Jun 6, 2023
Merged via the queue into main with commit cf0940c Jun 6, 2023
@BugenZhao BugenZhao deleted the bz/avoid-using-macro-in-parser branch June 6, 2023 17:03
lmatz pushed a commit that referenced this pull request Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/refactor Type: Refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants