Skip to content

Convert BuiltInWindowFunction::{Rank, PercentRank, DenseRank} to a user defined functions #12648

Closed

Description

@alamb

Is your feature request related to a problem or challenge?

Part of #8709

There is now no difference between "built in" / "prepackaged" scalar and aggregate functions in DataFusion, however there are still some "built in" window functions -- see the current source for BuiltInWindowFunction for the up to date list of what remains

The problem with having two different kinds of window functions is

  1. There are some features that may not be available to User Defined Window Functions that rely on built in
  2. Users can not easily choose which window functions to include or override the behavior if they need something different

Describe the solution you'd like

I would like to remove the "built in" version of this function and convert it to a user defined function

Describe alternatives you've considered

At a high level the process is:

  1. Add a new WindowUDFImpl in the functions-window crate
  2. Port the code from the relevant existing implementation of the the built in functions in datafusion/physical-expr/src/window
  3. Remove the BuiltInWindowFunction variant and then get everything to compile (the compiler will show you where the existing implementations are)

Additional context

Here are some good examples:

Activity

  1. alamb commented on Sep 27, 2024

    @alamb
    ContributorAuthor

    I think this is a good first issue for someone skilled in rust that wants to get a handle on how datafusion works. If you hit issues, let us know

  2. dharanad commented on Sep 27, 2024

    @dharanad
    Contributor

    take
    I think i should give up on this, let someone else who is new to this project take this up. Should be a good learning exp for them.

  3. removed their assignment
    on Sep 27, 2024
  4. hailelagi commented on Sep 27, 2024

    @hailelagi
    Contributor

    take (unless this might be intended for someone else, happy to step back)

  5. jatin510 commented on Sep 28, 2024

    @jatin510
    Contributor

    If you don't mind . Can i work on this issue @hailelagi ?

  6. removed their assignment
    on Sep 28, 2024
  7. jatin510 commented on Sep 28, 2024

    @jatin510
    Contributor

    take

  8. Omega359 commented on Sep 28, 2024

    @Omega359
    Contributor

    Convert BuiltInScalarFunction:: -> Convert BuiltInWindowFunction::{NthValue}

  9. changed the title [-]Convert `BuiltInScalarFunction::{Rank, PercentRank, DenseRank}` to a user defined functions[/-] [+]Convert `BuiltInWindowFunction::{Rank, PercentRank, DenseRank}` to a user defined functions[/+] on Sep 29, 2024
  10. SteNicholas commented on Sep 30, 2024

    @SteNicholas
    Member

    @jatin510, are you working on this ticket? I'm new comer to contribute. Could this ticket assign to me? cc @alamb

  11. jatin510 commented on Sep 30, 2024

    @jatin510
    Contributor

    Thanks for reaching out. I’m actually already working on this issue, and it’s my first task in the project as well. I’d like to continue with it. @SteNicholas

  12. jcsherin commented on Sep 30, 2024

    @jcsherin
    Contributor

    @SteNicholas Will you be interested in picking up ntile window function? It is also pending conversion to a user-defined window function and looks like a good first issue to me.

    See https://github.com/apache/datafusion/blob/main/datafusion/physical-expr/src/window/ntile.rs.

  13. added a commit that references this issue on Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions