Skip to content

Clarify min, max and rank documentation #8760

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

Merged
merged 2 commits into from
Apr 25, 2022
Merged

Conversation

Marcono1234
Copy link
Contributor

Currently the documentation sounds like the <expression> must always be "of numeric type or of type string", however that is incorrect, as also described correctly by the full language specification:

The type of the expression in a max, min or rank aggregation without an ordering directive expression must be an orderable type

(emphasis mine)

For example the following is valid:

import java

select min(File f | f.getExtension() = "java" | f order by f.getTotalNumberOfLines())
import java

select rank[5](File f | f.getExtension() = "java" | f order by f.getTotalNumberOfLines())

@Marcono1234 Marcono1234 changed the title Clarify min, max and rank documentation regarding expression type Clarify min, max and rank documentation Apr 16, 2022
Copy link
Contributor

@aschackmull aschackmull left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aschackmull aschackmull merged commit fd2904d into github:main Apr 25, 2022
@Marcono1234 Marcono1234 deleted the patch-1 branch April 25, 2022 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants