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

Allow execution of zero parameter functions #305

Closed
jimexist opened this issue May 10, 2021 · 4 comments · Fixed by #328
Closed

Allow execution of zero parameter functions #305

jimexist opened this issue May 10, 2021 · 4 comments · Fixed by #328
Labels
enhancement New feature or request

Comments

@jimexist
Copy link
Member

jimexist commented May 10, 2021

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

We shall allow the execution of zero parameter functions.

Describe the solution you'd like
A clear and concise description of what you want to happen.

One solution is to conventionally pass a null array with the correct expected batch size to ScalarFunctionImplementation so that functions with zero param can take that as input.

where the first param usize is the batch size

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jimexist jimexist added the enhancement New feature or request label May 10, 2021
@jorgecarleitao
Copy link
Member

Some alternatives:

  • create a node for these type of operations.

  • have the physical planner pass a NullArray to functions of zero arguments; NullArray has a length (only has a length).

@jimexist
Copy link
Member Author

@jorgecarleitao thanks for the advice. did you mean these two bullets combined as a solution?

@jorgecarleitao
Copy link
Member

They are independent solutions:

In the former, we have a new PhysicalExpr, that executes evaluates in a different way (by passing the length to the function)

In the latter, the planner would query the number of arguments of the expression, and if it is zero, would pass a NullArray to it (I do not have the exact solution atm).

In my opinion this issue should be written in a generic form, so that it focus on the problem and not on the solution. E.g. instead of "Allow ScalarFunctionImplementation to...", use "Allow execution of zero-argument functions".

It is not obvious to me that changing the signature of ScalarFunctionImplementation is the right approach here.

@jimexist
Copy link
Member Author

It is not obvious to me that changing the signature of ScalarFunctionImplementation is the right approach here.
Agree on this.

Let me rephrase

@jimexist jimexist changed the title Allow ScalarFunctionImplementation to take more than just args Allow execution of zero parameter functions May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment