Skip to content

Conversation

@thiagotognoli
Copy link

Fix: Serialization error when using sum on decimal values in aggregate expressions

This PR addresses a bug where using the sum aggregation on decimal properties would lead to a JSON serialization error due to missing or inconsistent scale information.

To resolve this, support for dynamic property options (e.g., scale) was added, allowing the aggregation parser and type constructor to handle decimal precision correctly during aggregation.

Key changes:

Introduced support for dynamic property options in aggregate expressions.

Ensured scale is preserved and correctly applied during parsing and result construction.

Improved compatibility with JSON serialization by ensuring consistent type metadata.

This fix is essential for systems that rely on precise decimal aggregation and downstream serialization (e.g., REST APIs or JSON-based storage).

thiagotognoli added 3 commits August 6, 2025 14:39
Ensures tests validate successful responses by checking status codes and reading from input streams instead of error streams.
Removes extraneous semicolons for code style consistency.
Adds Maven Invoker plugin to support integration testing scenarios.
Aligns all module parent references to the latest snapshot version
to ensure consistency and enable development on the 5.0.2 release line.
Facilitates dependency management and prepares for upcoming changes.
Introduces a mechanism to associate options, such as scale, with dynamic properties in aggregation expressions. Enhances flexibility for aggregate calculations, especially for methods requiring specific decimal precision. Improves property handling during parsing and type construction to better align with aggregation semantics.

This implementation was necessary to fix an issue where aggregations using sum on decimal values caused errors in the JSON serializer due to missing scale information.
Copilot AI review requested due to automatic review settings August 6, 2025 20:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

1 participant