waynexia opened a new pull request, #2587:
URL: https://github.com/apache/arrow-datafusion/pull/2587
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
Closes #.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
This PR tries a way to perform JIT'd computation over Arrow array.
As I understand, we have (at least) two ways to JIT the query execution. One
is to glue all the low-level compute functions together (those in arrow compute
kernel), and another is this PR, which tries to perform all the computation in
the JIT engine.
The first way is easier to implement (compared to the second one). And can
get performance improvement from eliminated dispatch and branch. However, the
second fully compiled way will take lots of effort as it requires a JIT version
of compute kernel.
[Gandiva](https://github.com/apache/arrow/tree/master/cpp/src/gandiva) in Arrow
C++ is an LLVM-based compute kernel that might help, but I'm not very familiar
with it. Whatever, being able to combine both ways should be a better situation
:laughing:.
Back to this PR, it will generate a loop like @Dandandan presented
[here](https://github.com/apache/arrow-datafusion/pull/2124#issuecomment-1083532239).
I haven't inspected whether the compiler will vectorize it. Currently, it only
wraps over one `expr`, but we can explore the possibility to compile multiple
`plan`s into one loop like
[here](https://www.vldb.org/pvldb/vol4/p539-neumann.pdf). The row format for
pipeline breaker is also significant to fully JIT.
This PR only implements a very early stage "example" with many hard-code
like types and fn sig. Please let me know what do you think of it!
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]