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

Commit

Permalink
using forward_as_tuple in multiple keys based SMJ (#74)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
  • Loading branch information
zhouyuan authored Feb 1, 2021
1 parent 02c83e2 commit c14a9a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ class ConditionedMergeJoinKernel::Impl {
auto left_tuple_name = left_paramater;
auto right_tuple_name = right_paramater;
if (project_output_list[0].size() > 1) {
function_define_ss << "auto left_tuple = std::make_tuple(" << left_paramater
function_define_ss << "auto left_tuple = std::forward_as_tuple(" << left_paramater
<< " );" << std::endl;
left_tuple_name = "left_tuple";
}
if (project_output_list[1].size() > 1) {
function_define_ss << "auto right_tuple = std::make_tuple(" << right_paramater
function_define_ss << "auto right_tuple = std::forward_as_tuple(" << right_paramater
<< " );" << std::endl;
right_tuple_name = "right_tuple";
}
Expand Down Expand Up @@ -929,4 +929,4 @@ arrow::Status ConditionedMergeJoinKernel::DoCodeGen(
} // namespace extra
} // namespace arrowcompute
} // namespace codegen
} // namespace sparkcolumnarplugin
} // namespace sparkcolumnarplugin
4 changes: 2 additions & 2 deletions cpp/src/codegen/arrow_compute/ext/merge_join_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ class ConditionedJoinArraysKernel::Impl {
std::stringstream ss;
std::string tuple_str;
if (multiple_cols) {
tuple_str = "std::make_tuple";
tuple_str = "std::forward_as_tuple";
}
if (multiple_cols) {
for (int i = 0; i < size; i++) {
Expand Down Expand Up @@ -1115,7 +1115,7 @@ class ConditionedJoinArraysKernel::Impl {
tuple_str += local_tuple;
}
tuple_str.erase(tuple_str.end() - 1, tuple_str.end());
ss << std::endl << "return {" + tuple_str + "};" << std::endl;
ss << std::endl << "return std::forward_as_tuple(" + tuple_str + ");" << std::endl;
} else {

ss << std::endl << "return it->GetView(segment_len);" << std::endl;
Expand Down

0 comments on commit c14a9a6

Please sign in to comment.