Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-17 Thread Benjamin Kietzman
Incorrect link last time, sorry: https://issues.apache.org/jira/browse/ARROW-11990 On Tue, Mar 16, 2021 at 4:19 PM Benjamin Kietzman wrote: > I've opened https://issues.apache.org/jira/browse/ARROW-11945 > to track this improvement. > > On Tue, Mar 16, 2021 at 3:40 PM Wes McKinney wrote: > >> I

Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-16 Thread Benjamin Kietzman
I've opened https://issues.apache.org/jira/browse/ARROW-11945 to track this improvement. On Tue, Mar 16, 2021 at 3:40 PM Wes McKinney wrote: > It seems fine to me to return Result from KernelInit (as long as a > context of some kind of still passed in to the function to have the > possibility of

Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-16 Thread Wes McKinney
It seems fine to me to return Result from KernelInit (as long as a context of some kind of still passed in to the function to have the possibility of passing other configuration bits), and it would make development more convenient to use a common error handling strategy in more places On Fri, Mar

Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-12 Thread Antoine Pitrou
I wouldn't mind changing those APIs to return a Status. I'll also note that KernelContext::SetStatus() isn't thread-safe. Regards Antoine. Le 12/03/2021 à 11:40, Benjamin Kietzman a écrit : My primary point is that using KernelContext to hold error statuses is confusing since there are more

Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-12 Thread Benjamin Kietzman
My primary point is that using KernelContext to hold error statuses is confusing since there are more places to check for an error condition. In the rest of the c++ library we use RETURN_NOT_OK or ARROW_ASSIGN_OR_RAISE to handle stack unwinding from an error, but in the presence of KernelContext it

Re: [DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-11 Thread Yibo Cai
Beside reporting errors, maybe a kernel wants to allocate memory through KernelContext::memory_pool [1] in Kernel::init? I'm not quite sure if this is a valid case. Would like to hear other comments. [1] https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernel.h#L95 Yibo On 3/

[DISCUSS][C++] Reduce usage of KernelContext in compute::

2021-03-11 Thread Benjamin Kietzman
KernelContext is a tuple consisting of a pointers to an ExecContext and KernelState and an error Status. The context's error Status may be set by compute kernels (for example when divide-by-zero would occur) rather than returning a Result as in the rest of the codebase. IIUC the intent is to avoid