Skip to content
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

Update ExprChecks for RowNumber. #12178

Open
wants to merge 1 commit into
base: branch-25.04
Choose a base branch
from

Conversation

mythrocks
Copy link
Collaborator

The supportedExprs.csv currently do not currently state that the RowNumber window function does not support an Array order-by column.

Indeed, on running such a query, one sees that the operation falls back to CPU:

scala> sql(" select row_number() over ( order by id_array ) from ... ").show
...
        !Expression <WindowSpecDefinition> windowspecdefinition(id_array#28 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) cannot run on GPU because order expression SortOrder id_array#28 ASC NULLS FIRST (ArrayType(LongType,true) is not supported)

This commit updates the registration of the RowNumber window fuction in GpuOverrides, to allow for the generated documentation to be updated.

Note that RowNumber could well be implemented to work in this case also, at a later date. That is out of the scope of this current change.

@mythrocks mythrocks self-assigned this Feb 19, 2025
The supportedExprs.csv currently do not currently state that the RowNumber
window function does not support an `Array` order-by column.

Indeed, on running such a query, one sees that the operation falls back to
CPU:
```
scala> sql(" select row_number() over ( order by id_array ) from ... ").show
...
        !Expression <WindowSpecDefinition> windowspecdefinition(id_array#28 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) cannot run on GPU because order expression SortOrder id_array#28 ASC NULLS FIRST (ArrayType(LongType,true) is not supported)
```

This commit updates the registration of the RowNumber window fuction in
`GpuOverrides`, to allow for the generated documentation to be updated.

Note that RowNumber could well implemented to work in this case also,
at a later date.  That is out of the scope of this current change.

Signed-off-by: MithunR <[email protected]>
@mythrocks mythrocks force-pushed the update-rownumber-expr-checks branch from fcdde5f to 408b67f Compare February 19, 2025 23:44
@sameerz sameerz added the documentation Improvements or additions to documentation label Feb 20, 2025
@mythrocks
Copy link
Collaborator Author

Build

@mythrocks
Copy link
Collaborator Author

For the record, this isn't only an update to documentation. This has an effect on how the fallback is signaled when the query is run.

@mythrocks
Copy link
Collaborator Author

I have filed another issue to improve row_number, to avoid fallbacks based on the types of the order-by column: #12182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants