MCPcopy Create free account
hub / github.com/apache/arrow / DecodeBinaryRoundingMode

Function DecodeBinaryRoundingMode

cpp/src/arrow/engine/substrait/extension_set.cc:836–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834}
835
836ExtensionIdRegistry::SubstraitCallToArrow DecodeBinaryRoundingMode(
837 const std::string& function_name) {
838 return [function_name](const SubstraitCall& call) -> Result<compute::Expression> {
839 ARROW_ASSIGN_OR_RAISE(
840 compute::RoundMode round_mode,
841 ParseOptionOrElse(
842 call, "rounding", kRoundModeParser,
843 {compute::RoundMode::DOWN, compute::RoundMode::UP,
844 compute::RoundMode::TOWARDS_ZERO, compute::RoundMode::TOWARDS_INFINITY,
845 compute::RoundMode::HALF_DOWN, compute::RoundMode::HALF_UP,
846 compute::RoundMode::HALF_TOWARDS_ZERO,
847 compute::RoundMode::HALF_TOWARDS_INFINITY, compute::RoundMode::HALF_TO_EVEN,
848 compute::RoundMode::HALF_TO_ODD},
849 compute::RoundMode::HALF_TO_EVEN));
850 ARROW_ASSIGN_OR_RAISE(std::vector<compute::Expression> value_args,
851 GetValueArgs(call, 0));
852 std::shared_ptr<compute::RoundBinaryOptions> options =
853 std::make_shared<compute::RoundBinaryOptions>();
854 options->round_mode = round_mode;
855 return arrow::compute::call("round_binary", std::move(value_args),
856 std::move(options));
857 };
858}
859
860template <bool kChecked>
861ExtensionIdRegistry::ArrowToSubstraitCall EncodeOptionlessOverflowableArithmetic(

Callers 1

Calls 3

GetValueArgsFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
callFunction · 0.50

Tested by

no test coverage detected