Skip to content

Commit

Permalink
ARROW-11741: [C++] Fix decimal casts on big endian platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Feb 24, 2021
1 parent 4b0375b commit b5126ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/src/arrow/compute/kernels/codegen_internal.h
Expand Up @@ -663,13 +663,14 @@ struct ScalarUnaryNotNullStateful {
static void Exec(const ThisType& functor, KernelContext* ctx, const ArrayData& arg0,
Datum* out) {
ArrayData* out_arr = out->mutable_array();
auto out_data = out_arr->GetMutableValues<Decimal128>(1);
auto out_data = out_arr->GetMutableValues<uint8_t>(1, 0) + 16 * out_arr->offset;
VisitArrayValuesInline<Arg0Type>(
arg0,
[&](Arg0Value v) {
*out_data++ = functor.op.template Call<OutValue, Arg0Value>(ctx, v);
functor.op.template Call<OutValue, Arg0Value>(ctx, v).ToBytes(out_data);
out_data += 16;
},
[&]() { ++out_data; });
[&]() { out_data += 16; });
}
};

Expand Down

0 comments on commit b5126ab

Please sign in to comment.