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: parse variable scale decimal in debezium json #10792

Merged
merged 3 commits into from
Jul 10, 2023
Merged

Conversation

tabVersion
Copy link
Contributor

@tabVersion tabVersion commented Jul 6, 2023

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

What's changed and what's your intention?

#10628

we cannot handle fixed scale and precision decimal because we don't see debezium schema when parsing.

Checklist

  • 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).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR contains 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

@github-actions github-actions bot added the type/fix Bug fix label Jul 6, 2023
@lmatz lmatz enabled auto-merge July 10, 2023 07:36
@lmatz lmatz added this pull request to the merge queue Jul 10, 2023
Merged via the queue into main with commit 18dfe71 Jul 10, 2023
@lmatz lmatz deleted the tab/dbz-json-decimal branch July 10, 2023 08:07
github-actions bot pushed a commit that referenced this pull request Jul 10, 2023
Co-authored-by: lmatz <lmatz823@gmail.com>
lmatz added a commit that referenced this pull request Jul 10, 2023
Co-authored-by: Bohan Zhang <tabvision@bupt.icu>
Co-authored-by: lmatz <lmatz823@gmail.com>
.ok_or_else(create_error)?
.as_str()
.unwrap()
.as_bytes();
Copy link
Contributor

Choose a reason for hiding this comment

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

We shall decode the JSON string as base64 to get bytes, rather than getting the UTF-8 bytes of this JSON string. Example in #10628 (comment):

  • JSON: "price":{"scale":1,"value":"AM0="}
  • base64 decode result: [0x00, 0xcd]
  • as_bytes: [0x41, 0x4d, 0x30, 0x3d]

Let me fix it.

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.

5 participants