You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
How to reproduce
auto fm=arrow::compute::GetFunctionRegistry();
ASSERT_OK(fm->AddAlias("alias_cast", "cast"));
auto s1=arrow::schema({arrow::field("f1", arrow::decimal128(30, 3))});
auto b=arrow::RecordBatchFromJSON(s1, R"([
["1.000"],
["-4567.890"]
])");
autoexpr=arrow::compute::call("alias_cast", {arrow::compute::field_ref("f1")},
arrow::compute::CastOptions::Unsafe(arrow::int32()));
ASSERT_OK_AND_ASSIGN(expr, expr.Bind(*s1)); // Bind failedASSERT_OK_AND_ASSIGN(autoinput, arrow::compute::MakeExecBatch(*s1, b));
ASSERT_OK_AND_ASSIGN(autores_dat,
arrow::compute::ExecuteScalarExpression(expr, input));
Bind failed with NotImplemented: Dispatch for a MetaFunction's Kernels.
Reason
BindNonRecursive will call arrow::compute::GetFunction, the function handle the cast with specific name and
return an original function object rather than CastFunction which override the DispatchExact.
inlineResult<std::shared_ptr<compute::Function>> GetFunction(
constExpression::Call&call, compute::ExecContext*exec_context) {
if (call.function_name!="cast") {
returnexec_context->func_registry()->GetFunction(call.function_name);
}
// XXX this special case is strange; why not make "cast" a ScalarFunction?constTypeHolder&to_type=
::arrow::internal::checked_cast<constcompute::CastOptions&>(*call.options).to_type;
returnGetCastFunction(*to_type);
}
It's a huge project for us to unify the CastFunction schedule path to standard ScalarFunction, so i think maybe we should ban AddAlias for cast?
Component(s)
C++
The text was updated successfully, but these errors were encountered:
… through AddAlias (#40200)
### Rationale for this change
Cast function bind failed after add a alias name through AddAlias.
### What changes are included in this PR?
Add a const `cast_function` which registered in `AddFunction` for check cast alias in `arrow::compute::GetFunction`.
### Are these changes tested?
Yes
### Are there any user-facing changes?
Yes, cast's alias name can also execute with expression system.
* GitHub Issue: #40183
Authored-by: hugo.zhang <hugo.zhang@openpie.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
…s name through AddAlias (apache#40200)
### Rationale for this change
Cast function bind failed after add a alias name through AddAlias.
### What changes are included in this PR?
Add a const `cast_function` which registered in `AddFunction` for check cast alias in `arrow::compute::GetFunction`.
### Are these changes tested?
Yes
### Are there any user-facing changes?
Yes, cast's alias name can also execute with expression system.
* GitHub Issue: apache#40183
Authored-by: hugo.zhang <hugo.zhang@openpie.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
thisisnic
pushed a commit
to thisisnic/arrow
that referenced
this issue
Mar 8, 2024
…s name through AddAlias (apache#40200)
### Rationale for this change
Cast function bind failed after add a alias name through AddAlias.
### What changes are included in this PR?
Add a const `cast_function` which registered in `AddFunction` for check cast alias in `arrow::compute::GetFunction`.
### Are these changes tested?
Yes
### Are there any user-facing changes?
Yes, cast's alias name can also execute with expression system.
* GitHub Issue: apache#40183
Authored-by: hugo.zhang <hugo.zhang@openpie.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
Describe the bug, including details regarding any error messages, version, and platform.
How to reproduce
Bind failed with
NotImplemented: Dispatch for a MetaFunction's Kernels
.Reason
BindNonRecursive
will callarrow::compute::GetFunction
, the function handle the cast with specific name andreturn an original function object rather than
CastFunction
which override theDispatchExact
.It's a huge project for us to unify the CastFunction schedule path to standard
ScalarFunction
, so i think maybe we should ban AddAlias forcast
?Component(s)
C++
The text was updated successfully, but these errors were encountered: