[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-07 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488129#comment-17488129
 ] 

Yaron Gvili commented on ARROW-15571:
-

Since plenty of NaN values exist, I find returning an input NaN value more 
user-friendly then returning a null, which just drops information, which can 
always be done in a later step. However, if there is a convention that other 
operations conform to on this issue, then it should probably be followed on.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-07 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488098#comment-17488098
 ] 

David Li commented on ARROW-15571:
--

There are no operations that return NaN instead of null in this case. It could 
perhaps be added as an option (that would also be a separate JIRA)

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-06 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487692#comment-17487692
 ] 

Yaron Gvili commented on ARROW-15571:
-

I'm good with splitting the issue; I'll get to that a bit later.

In the meantime, something I just noticed: "min_element_wise" is equivalent to 
"minimum_checked", both ignoring a single NaN input, but not to "minimum", 
which returns a single NaN input (the same applies to the corresponding max 
functions). Are there existing min/max operations that have this latter 
behavior?

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-06 Thread Yibo Cai (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487648#comment-17487648
 ] 

Yibo Cai commented on ARROW-15571:
--

Better to separate "sqrt" and "elementwise min/max" to two PRs. They are very 
different.
Maybe rename this Jira (and related PR) to "sqrt" only, and create a new Jira 
for "improve elementwise min/max for special cases"?

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-05 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487569#comment-17487569
 ] 

Yaron Gvili commented on ARROW-15571:
-

Sounds good. Please advise on what I should add to the PR, like what to cover 
in unit tests. To keep the PR tight, could the dispatching be deferred to a 
separate one?

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-05 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487565#comment-17487565
 ] 

David Li commented on ARROW-15571:
--

That also makes a lot of sense! We should definitely have sqrt.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-05 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487562#comment-17487562
 ] 

Yaron Gvili commented on ARROW-15571:
-

A [comment in the 
PR|https://github.com/apache/arrow/pull/12338#issuecomment-1030529616] reports 
on a benchmark showing sqrt(x ) being much faster than pow(x, 0.5).

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-05 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487561#comment-17487561
 ] 

David Li commented on ARROW-15571:
--

Thanks for the code. That's not surprising, considering the elementwise min/max 
are variadic. We could dispatch to the specialized case for when we have only 
two arguments, though (and we could add this benchmark to the upstream 
benchmarks to track the improvement).

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-05 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487559#comment-17487559
 ] 

Yaron Gvili commented on ARROW-15571:
-

Running the benchmark code below on my CPU "Intel(R) Core(TM) i7-10875H CPU @ 
2.30GHz" showed the minimum/maximum operations in my PR are faster when 
operating on a single array/column. For an array of size 1M the speed-up factor 
was ~1.5 and even higher for shorter arrays.

 
{code:java}
#include 
#include 

#include 
#include 
#include 
#include 

uint64_t get_time() {
  return std::chrono::high_resolution_clock::now().time_since_epoch().count();
}

arrow::Status RunMain(int argc, char **argv) {
  constexpr int n = 100;
  arrow::DoubleBuilder builder;
  builder.Reserve(n);
  for (int i=0; i array = *maybe_array;
  std::shared_ptr low_threshold = 
std::make_shared(0.1);
  std::shared_ptr high_threshold = 
std::make_shared(0.8);

  uint64_t t;

  t = get_time();
  ARROW_ASSIGN_OR_RAISE(arrow::Datum max0, 
arrow::compute::CallFunction("max_element_wise", {array, low_threshold}));
  ARROW_ASSIGN_OR_RAISE(arrow::Datum min0, 
arrow::compute::CallFunction("min_element_wise", {max0, high_threshold}));
  uint64_t t0 = get_time() - t;

  t = get_time();
  ARROW_ASSIGN_OR_RAISE(arrow::Datum max1, 
arrow::compute::CallFunction("maximum", {array, low_threshold}));
  ARROW_ASSIGN_OR_RAISE(arrow::Datum min1, 
arrow::compute::CallFunction("minimum", {max1, high_threshold}));
  uint64_t t1 = get_time() - t;

  if (!arrow::ArrayEquals(*min0.make_array(), *min1.make_array())) {
    return arrow::Status::Invalid("result arrays are not equal");
  }
  std::cout << "timing: " << t0 << " vs " << t1 << " (speed-up factor " << (1.0 
* t0 / t1) << ")" << std::endl;

  return arrow::Status::OK();
} 
  
int main(int argc, char **argv) {
  arrow::Status st = RunMain(argc, argv);
  if (!st.ok()) {
    std::cerr << st << std::endl;
    return 1;
  }
  return 0;
} {code}
 

 

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487214#comment-17487214
 ] 

Yaron Gvili commented on ARROW-15571:
-

OK, I'll try to set up and report back on a benchmark comparing the suggested 
operations and the ones in my PR.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Rok Mihevc (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487207#comment-17487207
 ] 

Rok Mihevc commented on ARROW-15571:


Python maps directly to c++ kernels here and it's less verbose.

Perhaps take a look at 
[https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/scalar_compare_test.cc#L1228]
 and 
[https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/scalar_arithmetic_test.cc#L932]
 to get c++ implementation start.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487204#comment-17487204
 ] 

David Li commented on ARROW-15571:
--

I think we're missing some terminology here.

Note the Python functions are the exact same as the C++ ones. Rok's example can 
be translated to C++ and they both use the same implementation here.

Scalar functions operate on array and scalar values. "Scalar" just means that 
they operate elementwise.

Aggregate functions reduce multiple values to one. It seems they are not what 
you are looking for here. However, again, note that min/max both have aggregate 
versions (min(array) -> scalar) and scalar versions (min(array, array) -> array 
or min(scalar, array) -> array or ...). So I think Rok's suggestion is what you 
are looking for.

If performance is not up to par in benchmarks, then there is opportunity to 
optimize. (The scalar min/max kernels do some extra work because they take any 
number of arguments, for instance - though I don't recall if they have 
specializations for binary inputs.)

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487199#comment-17487199
 ] 

Yaron Gvili commented on ARROW-15571:
-

The code seems reasonable for a Python setting, but I'm targeting the C++ 
execution engine (specifically, projection using an expression), and would like 
to get best performance. My guess is scalar operations are faster than 
aggregate ones for scalar use cases of the kind I described. Otherwise, it's 
not clear to me why some operation, such as Add, is implemented as both a 
scalar and an aggregate one.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Rok Mihevc (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487186#comment-17487186
 ] 

Rok Mihevc commented on ARROW-15571:


In pyarrow 7.0.0 that would be something like this? :

{code:python}
import pyarrow as pa
import pyarrow.compute as pc

low_threshold = 1
high_threshold = 3

arr = pa.array([1, 2, 3])
pc.min_element_wise(pc.max_element_wise(pc.power(arr, 0.5), low_threshold), 
high_threshold)
{code}


> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487181#comment-17487181
 ] 

Yaron Gvili commented on ARROW-15571:
-

OK regarding power working on floating point values. This 
[SO|https://stackoverflow.com/questions/17417490/difference-between-sqrtx-and-powx-0-5]
 suggests sqrt(x) would be faster and a bit more accurate than pow(x, 0.5), so 
there is room for a sqrt operation.

Regarding my goal, it is to apply the operations to a single column with best 
performance in Arrow. Here's an example for how I'm currently invoking the code 
in my PR:

 
{code:java}
ProjectNodeOptions(
    {call("minimum",
        {call("maximum",
            {call("square_root",
                {field_ref("column_0")}),
            literal(low_threshold)}),
        literal(high_threshold)})},
    {"result_0"}){code}
Note that the above is `using namespace arrow::compute` and that "column_0" is 
of type double. How should I achieve the same functionality with the existing 
operations? If the solution involves aggregate operations, do they provide best 
performance, as compared to (the missing) scalar operations?

 

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487164#comment-17487164
 ] 

David Li commented on ARROW-15571:
--

Looking at the PR you're looking for a row-wise min/max? In which case that is 
implemented on floating point values, yes. (It will also work given scalar 
values.)

Power also works on floating point values.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Yaron Gvili (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487158#comment-17487158
 ] 

Yaron Gvili commented on ARROW-15571:
-

Sorry, I should have been cleared in the title that I'm referring to floating 
point scalars. Are the aggregate operations good for operating on floating 
point scalars, rather than arrays? Is power good for operating on floating 
points, rather than integers? I'm relatively new to Arrow, so I may have missed 
a couple of things.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>  Labels: kernel, pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread David Li (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487143#comment-17487143
 ] 

David Li commented on ARROW-15571:
--

Min/max are available as aggregations: 
[https://arrow.apache.org/docs/dev/cpp/compute.html#aggregations] and there are 
also element-wise min/max: 
[https://arrow.apache.org/docs/dev/cpp/compute.html#comparisons]

Square root is indeed not available, though power is: 
[https://arrow.apache.org/docs/dev/cpp/compute.html#arithmetic-functions] 
(presumably, a dedicated sqrt would be faster, though)

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (ARROW-15571) [C++] Add min/max/sqrt scalar kernels to execution engine

2022-02-04 Thread Rok Mihevc (Jira)


[ 
https://issues.apache.org/jira/browse/ARROW-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17487142#comment-17487142
 ] 

Rok Mihevc commented on ARROW-15571:


Min and max are covered in 
https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/aggregate_basic.cc.

> [C++] Add min/max/sqrt scalar kernels to execution engine
> -
>
> Key: ARROW-15571
> URL: https://issues.apache.org/jira/browse/ARROW-15571
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: Yaron Gvili
>Priority: Major
>
> The list of execution engine's scalar kernels currently available in 
> `cpp/src/arrow/compute/kernels/scalar_arithmetic.cc` does not cover the 
> common minimum, maximum, and square-root functions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)