Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented May 20, 2025

Motivation

Screenshot 2025-05-20 at 11 48 56

The original implementation of decoding was introduced by #15687, The implementation is as follows

String textValue = value.isValueNode() ? value.asText() : value.toString();
if (type instanceof DecimalType) {
    textValue = textValue.replace(".", "");
    BigInteger bigInteger = new BigInteger(textValue);
    return Decimals.encodeUnscaledValue(bigInteger);
}

#20016 introduced a break change, which added a classcast from object to DecimalNode, The implementation was changed to as follows

// value is typed "Object", the actual type is a JsonNode
final DecimalNode node = (DecimalNode) value;
type.writeObject(blockBuilder, Int128.valueOf(node.asText().replace(".", "")));

Modifications

Revert the implementation to the original.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode added type/bug The PR fixed a bug or issue reported a bug release/3.0.12 labels May 20, 2025
@github-actions
Copy link

@poorbarcode Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels May 20, 2025
@poorbarcode poorbarcode requested review from lhotari, shibd and tisonkun May 20, 2025 03:51
…resto/decoder/json/PulsarJsonFieldDecoder.java

Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
@poorbarcode
Copy link
Contributor Author

Please do not merge this PR so far, I am fixing an issue

@poorbarcode
Copy link
Contributor Author

Please do not merge this PR so far, I am fixing an issue

Sorry, I tested with the wrong code, so there is no issue

@poorbarcode poorbarcode merged commit 396a8ee into apache:branch-3.0 May 21, 2025
45 checks passed
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 28, 2025
… value (apache#24317)

Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
(cherry picked from commit 396a8ee)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 28, 2025
… value (apache#24317)

Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 29, 2025
… value (apache#24317)

Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
(cherry picked from commit 396a8ee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/branch-3.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.12 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants