Fix grouped MAX for non-positive floating-point values#18300
Merged
JackieTien97 merged 1 commit intoJul 24, 2026
Merged
Conversation
JackieTien97
marked this pull request as ready for review
July 24, 2026 08:50
CritasWang
approved these changes
Jul 24, 2026
Collaborator
|
I think this PR needs to be updated to 2.0.11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix table-model grouped
MAXreturningNULLwhen everyFLOATorDOUBLEvalue in a group is zero or negative.
GroupedMaxAccumulatorinitialized floating-point states withFloat.MIN_VALUEand
Double.MIN_VALUE. In Java, those constants are the smallest positivevalues, not the most negative values. As a result, non-positive inputs never
initialized the group state, and the final result was emitted as
NULL.MAX_BYwas unaffected because its implementation explicitly handles the firstinput value.
Changes
MAXstates with negative infinity.raw and intermediate inputs.
NULL.aggregation path.
User impact
Grouped
MAX(FLOAT)andMAX(DOUBLE)now return the correct value for groupswhose maximum is non-positive, including all-zero groups.
Validation
mvn clean test -pl iotdb-core/calc-commons \ -Dtest=GroupedMaxAccumulatorTest mvn clean verify -Drat.skip=true -DskipUTs \ -Dit.test=IoTDBTableAggregationNonStreamIT#maxNonPositiveFloatingPointTest \ -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false \ -pl integration-test -am -PTableSimpleIT -P with-integration-testsThe targeted integration test passed and the 37-module clean reactor build
completed successfully.