Skip to content

Commit

Permalink
fix _pointer_ in casts
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilson committed Sep 24, 2024
1 parent 57e655c commit ac05e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/aggregate_basic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ struct ProductImpl : public ScalarAggregator {
Status Finalize(KernelContext*, Datum* out) override {
std::shared_ptr<DataType> out_type_;
if (out_type->id() == Type::DECIMAL128) {
auto cast_type = checked_cast<Decimal128Type>(out_type);
auto cast_type = checked_pointer_cast<Decimal128Type>(this->out_type);
ARROW_ASSIGN_OR_RAISE(out_type_, Decimal128Type::Make(Decimal128Type::kMaxPrecision,
cast_type->scale()));
} else if (out_type->id() == Type::DECIMAL256) {
auto cast_type = checked_cast<Decimal256Type>(out_type);
auto cast_type = checked_pointer_cast<Decimal256Type>(this->out_type);
ARROW_ASSIGN_OR_RAISE(out_type_, Decimal256Type::Make(Decimal256Type::kMaxPrecision,
cast_type->scale()));
} else {
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/arrow/compute/kernels/aggregate_basic.inc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ struct SumImpl : public ScalarAggregator {
Status Finalize(KernelContext*, Datum* out) override {
std::shared_ptr<DataType> out_type_;
if (out_type->id() == Type::DECIMAL128) {
auto cast_type = checked_cast<Decimal128Type>(out_type);
auto cast_type = checked_pointer_cast<Decimal128Type>(this->out_type);
ARROW_ASSIGN_OR_RAISE(out_type_, Decimal128Type::Make(Decimal128Type::kMaxPrecision,
cast_type->scale()));
} else if (out_type->id() == Type::DECIMAL256) {
auto cast_type = checked_cast<Decimal256Type>(out_type);
auto cast_type = checked_pointer_cast<Decimal256Type>(this->out_type);
ARROW_ASSIGN_OR_RAISE(out_type_, Decimal256Type::Make(Decimal256Type::kMaxPrecision,
cast_type->scale()));
} else {
Expand Down Expand Up @@ -233,7 +233,7 @@ struct MeanImpl<ArrowType, SimdLevel, enable_if_decimal<ArrowType>>
template <typename T = ArrowType>
Status FinalizeImpl(Datum* out) {
std::shared_ptr<DataType> out_type_;
auto decimal_type = checked_cast<DecimalType>(this->out_type);
auto decimal_type = checked_pointer_cast<DecimalType>(this->out_type);
if (decimal_type->id() == Type::DECIMAL128) {
ARROW_ASSIGN_OR_RAISE(out_type_, Decimal128Type::Make(Decimal128Type::kMaxPrecision,
decimal_type->scale()));
Expand Down

0 comments on commit ac05e70

Please sign in to comment.