bkmgit commented on pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#issuecomment-1002987357
These are good suggestions, thanks for your feedback. Can change BETWEEN to
use options as the default. It seems we may also need NOT BETWEEN but will
leave this for later if it is desired as it is in SQL. Language specific
bindings may want to have additional features to make transitioning users
easier.
That being said, a single arithmetic function is quite desirable. One could
do
ARITHMETIC("add", a, b)
ARITHMETIC("multiply",a,b)
ARITHMETIC("modulo",a,b)
At the moment there is:
ARROW_ASSIGN_OR_RAISE(incremented_datum,
arrow::compute::CallFunction("add", {numbers_array,
increment}));
and the internal API which can be directly called
ARROW_ASSIGN_OR_RAISE(incremented_datum,
arrow::compute::Add(numbers_array, increment));
Internally, it would be nicer to have
ARROW_ASSIGN_OR_RAISE(incremented_datum,
arrow::compute::Arithmetic::Add(numbers_array,
increment));
Templating could generate the related kernels efficiently, which would be
useful for porting to GPUs and for kernel optimization. At the moment, related
operations are put in the same file, but there is no other hierarchy for
compute functions.
Similarly, one would have
COMPARE(a,b,"gt")
COMPARE(a,b,"ge")
COMPARE(a,b,"lt")
COMPARE(a,b,"le")
BETWEEN(val,a,b,"both")
BETWEEN(val,a,b,"left")
BETWEEN(val,a,b,"right")
BETWEEN(val,a,b,"neither")
NOT_BETWEEN(val,a,b,"both")
NOT_BETWEEN(val,a,b,"left")
NOT_BETWEEN(val,a,b,"right")
NOT_BETWEEN(val,a,b,"neither")
These would all be within scalar_compare.cc If the BETWEEN function with
options works okay, maybe we can transition GREATER, GREATER_EQUAL etc. to have
a common COMPARE function with an option, as well as alternative bindings?
--
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]