Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
Pass input list in const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Aug 18, 2022
1 parent c5bba6b commit 1da378b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
62 changes: 31 additions & 31 deletions native-sql-engine/cpp/src/codegen/arrow_compute/ext/actions_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ struct FindAccumulatorType<I, arrow::enable_if_floating_point<I>> {
using Type = arrow::DoubleType;
};

arrow::Status ActionBase::Submit(ArrayList in, int max_group_id,
arrow::Status ActionBase::Submit(const ArrayList& in, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) {
return arrow::Status::NotImplemented("ActionBase Submit is abstract.");
}

arrow::Status ActionBase::Submit(
std::vector<std::shared_ptr<arrow::Array>> in,
const std::vector<std::shared_ptr<arrow::Array>>& in,
std::function<arrow::Status(uint64_t, uint64_t)>* on_valid,
std::function<arrow::Status()>* on_null) {
return arrow::Status::NotImplemented("ActionBase Submit is abstract.");
Expand Down Expand Up @@ -137,7 +137,7 @@ class UniqueAction : public ActionBase {
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -296,7 +296,7 @@ class CountAction : public ActionBase {
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -458,7 +458,7 @@ class CountLiteralAction : public ActionBase {
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -582,7 +582,7 @@ class MinAction<DataType, CType, precompile::enable_if_number<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -864,7 +864,7 @@ class MinAction<DataType, CType, precompile::enable_if_decimal<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1021,7 +1021,7 @@ class MinAction<DataType, CType, precompile::enable_if_string_like<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1192,7 +1192,7 @@ class MaxAction<DataType, CType, precompile::enable_if_number<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1469,7 +1469,7 @@ class MaxAction<DataType, CType, precompile::enable_if_decimal<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1625,7 +1625,7 @@ class MaxAction<DataType, CType, precompile::enable_if_string_like<DataType>>
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1798,7 +1798,7 @@ class SumAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -1959,7 +1959,7 @@ class SumAction<DataType, CType, ResDataType, ResCType,

int RequiredColNum() { return 1; }

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -2126,7 +2126,7 @@ class SumActionPartial<DataType, CType, ResDataType, ResCType,

int RequiredColNum() { return 1; }

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -2292,7 +2292,7 @@ class SumActionPartial<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -2463,7 +2463,7 @@ class AvgAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -2634,7 +2634,7 @@ class AvgAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -2821,7 +2821,7 @@ class SumCountAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3010,7 +3010,7 @@ class SumCountAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3195,7 +3195,7 @@ class SumCountMergeAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3376,7 +3376,7 @@ class SumCountMergeAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3546,7 +3546,7 @@ class AvgByCountAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3726,7 +3726,7 @@ class AvgByCountAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -3921,7 +3921,7 @@ class StddevSampPartialAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -4155,7 +4155,7 @@ class StddevSampPartialAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -4382,7 +4382,7 @@ class StddevSampFinalAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -4589,7 +4589,7 @@ class StddevSampFinalAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -4828,7 +4828,7 @@ class FirstPartialAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -5067,7 +5067,7 @@ class FirstPartialAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -5303,7 +5303,7 @@ class FirstFinalAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down Expand Up @@ -5563,7 +5563,7 @@ class FirstFinalAction<DataType, CType, ResDataType, ResCType,
#endif
}

arrow::Status Submit(ArrayList in_list, int max_group_id,
arrow::Status Submit(const ArrayList& in_list, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null) override {
// resize result data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class ActionBase {
public:
virtual ~ActionBase() {}

virtual arrow::Status Submit(ArrayList in, int max_group_id,
virtual arrow::Status Submit(const ArrayList& in, int max_group_id,
std::function<arrow::Status(int)>* on_valid,
std::function<arrow::Status()>* on_null);
virtual arrow::Status Submit(std::vector<std::shared_ptr<arrow::Array>> in,
virtual arrow::Status Submit(const std::vector<std::shared_ptr<arrow::Array>>& in,
std::function<arrow::Status(uint64_t, uint64_t)>* on_valid,
std::function<arrow::Status()>* on_null);
virtual arrow::Status Submit(const std::shared_ptr<arrow::Array>& in,
Expand Down

0 comments on commit 1da378b

Please sign in to comment.