Skip to content

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