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

Function CastFloatingToInteger

cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc:190–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190Status CastFloatingToInteger(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
191 const auto& options = checked_cast<const CastState*>(ctx->state())->options;
192 CastNumberToNumberUnsafe(batch[0].type()->id(), out->type()->id(), batch[0].array,
193 out->array_span_mutable());
194 if (!options.allow_float_truncate) {
195 RETURN_NOT_OK(CheckFloatToIntTruncation(batch[0], *out));
196 }
197 return Status::OK();
198}
199
200// ----------------------------------------------------------------------
201// Implement fast integer to floating point cast

Callers

nothing calls this directly

Calls 6

CastNumberToNumberUnsafeFunction · 0.85
OKFunction · 0.50
stateMethod · 0.45
idMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected