drabastomek commented on code in PR #14434:
URL: https://github.com/apache/arrow/pull/14434#discussion_r1003984637
##########
cpp/src/arrow/engine/substrait/extension_set.cc:
##########
@@ -858,11 +867,34 @@ struct DefaultExtensionIdRegistry :
ExtensionIdRegistryImpl {
// -------------- Substrait -> Arrow Functions -----------------
// Mappings with a _checked variant
- for (const auto& function_name : {"add", "subtract", "multiply",
"divide"}) {
+ for (const auto& function_name :
+ {"add", "subtract", "multiply", "divide", "power", "sqrt", "abs"}) {
Review Comment:
Ha -- good catch. I changed the `DecodeOptionlessUncheckedArithmetic` and
updated the tests.
##########
cpp/src/arrow/engine/substrait/extension_set.cc:
##########
@@ -858,11 +867,34 @@ struct DefaultExtensionIdRegistry :
ExtensionIdRegistryImpl {
// -------------- Substrait -> Arrow Functions -----------------
// Mappings with a _checked variant
- for (const auto& function_name : {"add", "subtract", "multiply",
"divide"}) {
+ for (const auto& function_name :
+ {"add", "subtract", "multiply", "divide", "power", "sqrt", "abs"}) {
DCHECK_OK(
AddSubstraitCallToArrow({kSubstraitArithmeticFunctionsUri,
function_name},
DecodeOptionlessOverflowableArithmetic(function_name)));
}
+
+ // Mappings without a _checked variant
+ for (const auto& function_name : {"exp", "sign"}) {
+ DCHECK_OK(
+ AddSubstraitCallToArrow({kSubstraitArithmeticFunctionsUri,
function_name},
+
DecodeOptionlessUncheckedArithmetic(function_name)));
+ }
+
+ // Mappings for log functions
+ for (const auto& function_name : {"ln", "log10", "log2", "logb", "log1p"})
{
+ DCHECK_OK(
+ AddSubstraitCallToArrow({kSubstraitLogarithmicFunctionsUri,
function_name},
+
DecodeOptionlessOverflowableArithmetic(function_name)));
Review Comment:
I changed the DecodeOptionlessUncheckedArithmetic and updated the tests.
--
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]