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

Function DecodeBinaryRoundingMode

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

Source from the content-addressed store, hash-verified

849}
850
851ExtensionIdRegistry::SubstraitCallToArrow DecodeBinaryRoundingMode(
852 const std::string& function_name) {
853 return [function_name](const SubstraitCall& call) -> Result<compute::Expression> {
854 ARROW_ASSIGN_OR_RAISE(
855 compute::RoundMode round_mode,
856 ParseOptionOrElse(
857 call, "rounding", kRoundModeParser,
858 {compute::RoundMode::DOWN, compute::RoundMode::UP,
859 compute::RoundMode::TOWARDS_ZERO, compute::RoundMode::TOWARDS_INFINITY,
860 compute::RoundMode::HALF_DOWN, compute::RoundMode::HALF_UP,
861 compute::RoundMode::HALF_TOWARDS_ZERO,
862 compute::RoundMode::HALF_TOWARDS_INFINITY, compute::RoundMode::HALF_TO_EVEN,
863 compute::RoundMode::HALF_TO_ODD},
864 compute::RoundMode::HALF_TO_EVEN));
865 ARROW_ASSIGN_OR_RAISE(std::vector<compute::Expression> value_args,
866 GetValueArgs(call, 0));
867 std::shared_ptr<compute::RoundBinaryOptions> options =
868 std::make_shared<compute::RoundBinaryOptions>();
869 options->round_mode = round_mode;
870 return arrow::compute::call("round_binary", std::move(value_args),
871 std::move(options));
872 };
873}
874
875template <bool kChecked>
876ExtensionIdRegistry::ArrowToSubstraitCall EncodeOptionlessOverflowableArithmetic(

Callers 1

Calls 3

GetValueArgsFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
callFunction · 0.50

Tested by

no test coverage detected