jrecuerda opened a new issue #11799:
URL: https://github.com/apache/arrow/issues/11799
I am not able to use the `hash_*` compute functions. I have tried both in
python and directly in C++ but I am always getting the following error:
```
Function hash_sum has no kernel matching input types (array[int64],
array[string])
```
I have tried multiple combinations of input types: float-int64,
float-string, double-string, double-int64...
These are two simplified examples of what I'm trying:
### Python
```
>>> import pyarrow.compute as pc
>>> pc.sum([1,2,3])
<pyarrow.Int64Scalar: 6>
>>> pc.hash_sum([1,2,3], ["a", "b", "a"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vscode/.local/lib/python3.6/site-packages/pyarrow/compute.py",
line 191, in wrapper
return func.call(args, options, memory_pool)
File "pyarrow/_compute.pyx", line 327, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 143, in
pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 120, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Function hash_sum has no kernel
matching input types (array[int64], array[string])
```
### C++
```
arrow::DoubleBuilder builder;
builder.Append(1);
builder.Append(2);
builder.Append(3);
auto array = builder.Finish();
arrow::StringBuilder builderStr;
builderStr.Append("a");
builderStr.Append("b");
builderStr.Append("a");
auto arrayKey = builderStr.Finish();
std::vector<std::shared_ptr<arrow::Field>> schema_vector = {
arrow::field("id", arrow::float64()), arrow::field("cat",
arrow::utf8())};
auto schema = std::make_shared<arrow::Schema>(schema_vector);
auto table = arrow::Table::Make(schema, {*array, *arrayKey});
auto res = arrow::compute::CallFunction(std::string("hash_count"),
{table->GetColumnByName("id"), table->GetColumnByName("cat")});
```
What am I missing?
--
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]