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

fix: protobuf fixed64 was incorrectly parsed as int64 #12126

Merged
merged 5 commits into from
Sep 8, 2023
Merged

Conversation

neverchanje
Copy link
Contributor

@neverchanje neverchanje commented Sep 6, 2023

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

What's changed and what's your intention?

Protobuf's fixed64 was mapped to RisingWave's int64 (bigint) during create source.

However, prost treats fixed64 as uint64 and then we actually turned uint64 into decimals during parsing. As a result, there was a mismatch between the actual array's type (bigint) and the value's type (decimal).

image

This PR fixes this bug and map fixed64 to decimal instead.

Additionally, this PR rejects the map type in Protobuf. Because we don't yet have a correct handling path. Previously, we convert map to LIST<STRUCT<key VARCHAR, value INT32>>, which is unexpected.

related issue: #10479

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@github-actions github-actions bot added the type/fix Bug fix label Sep 6, 2023
@neverchanje neverchanje marked this pull request as ready for review September 6, 2023 11:22
@neverchanje neverchanje requested a review from a team as a code owner September 6, 2023 11:23
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #12126 (df59b05) into main (f1672f7) will increase coverage by 0.04%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##             main   #12126      +/-   ##
==========================================
+ Coverage   69.77%   69.82%   +0.04%     
==========================================
  Files        1406     1406              
  Lines      235333   235518     +185     
==========================================
+ Hits       164203   164445     +242     
+ Misses      71130    71073      -57     
Flag Coverage Δ
rust 69.82% <97.50%> (+0.04%) ⬆️

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

Files Changed Coverage Δ
src/connector/src/parser/protobuf/parser.rs 86.21% <97.50%> (+17.39%) ⬆️

... and 7 files with indirect coverage changes

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

Copy link
Contributor

@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

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

rest LGTM

src/connector/src/parser/protobuf/parser.rs Show resolved Hide resolved
Copy link
Contributor

@TennyZhuang TennyZhuang left a comment

Choose a reason for hiding this comment

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

lock file changes LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants