Skip to content

Conversation

@jonathanc-n
Copy link
Contributor

Which issue does this PR close?

Closes #12716.

Rationale for this change

Handles case where min/max are infinite or not a number (NaN)

What changes are included in this PR?

Checks if min/max values are infinite or NaN + tests

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Oct 9, 2024
let mut min = cast_scalar_f64!(&state[4]);

assert!(max.total_cmp(&min).is_ge());
if !min.is_finite() {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be reasonable to filter out NaN values in merge_sorted_f64 / merge_unsorted_f64 functions?

Copy link
Contributor Author

@jonathanc-n jonathanc-n Oct 9, 2024

Choose a reason for hiding this comment

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

@findepi Oh, I think the problem here is that it'd be hard to match the expected behaviour of postgresql for other tests. refer to #11934

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @jonathanc-n and @findepi -- looks very nice to me

@jonahgao jonahgao merged commit 58c7085 into apache:main Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in scalar function approx_percentile_cont_with_weight (SQLancer)

4 participants