diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/codegen_common.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/codegen_common.cc index 0263724cd..0ec53a11e 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/codegen_common.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/codegen_common.cc @@ -630,7 +630,8 @@ arrow::Status CompileCodes(std::string codes, std::string signature) { } std::string libwscgfile = GetTempPath() + "/nativesql_include/precompile/wscgapi.hpp"; - std::string libwscg_pch = GetTempPath() + "/nativesql_include/precompile/wscgapi.hpp.gch"; + std::string libwscg_pch = + GetTempPath() + "/nativesql_include/precompile/wscgapi.hpp.gch"; const char* env_arrow_dir = std::getenv("LIBARROW_DIR"); std::string arrow_header; std::string arrow_lib, arrow_lib2; @@ -651,23 +652,21 @@ arrow::Status CompileCodes(std::string codes, std::string signature) { auto ret = stat(libwscg_pch.c_str(), &pch_stat); if (ret == -1) { cmd += env_gcc + " -std=c++14 -Wno-deprecated-declarations " + arrow_header + - arrow_lib + arrow_lib2 + nativesql_header + nativesql_header_2 - + " -c " + - libwscgfile + env_codegen_option + " -fPIC && "; - + arrow_lib + arrow_lib2 + nativesql_header + nativesql_header_2 + " -c " + + libwscgfile + env_codegen_option + " -fPIC && "; } cmd += env_gcc + " -std=c++14 -Wno-deprecated-declarations " + arrow_header + - nativesql_header + nativesql_header_2 + " -c " + - cppfile + " -o "+ objfile + env_codegen_option + "-fPIC && "; + nativesql_header + nativesql_header_2 + " -c " + cppfile + " -o " + objfile + + env_codegen_option + "-fPIC && "; // linking - cmd += env_gcc + arrow_lib + arrow_lib2 + nativesql_lib + - objfile + " -o " + libfile + " -lspark_columnar_jni -shared && "; + cmd += env_gcc + arrow_lib + arrow_lib2 + nativesql_lib + objfile + " -o " + libfile + + " -lspark_columnar_jni -shared && "; // package cmd += "cd " + outpath + " && jar -cf spark-columnar-plugin-codegen-precompile-" + - signature + ".jar spark-columnar-plugin-codegen-" + signature + ".so 2>" + logfile; - + signature + ".jar spark-columnar-plugin-codegen-" + signature + ".so 2>" + + logfile; #ifdef DEBUG std::cout << cmd << std::endl; diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_merge_join_kernel.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_merge_join_kernel.cc index 1a1d92c6c..0bf504f82 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_merge_join_kernel.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_merge_join_kernel.cc @@ -108,8 +108,6 @@ class ConditionedMergeJoinKernel::Impl { auto codegen_ctx = std::make_shared(); bool use_relation_for_stream = input.empty(); - - std::vector prepare_list; bool cond_check = false; if (condition_) cond_check = true; @@ -118,7 +116,6 @@ class ConditionedMergeJoinKernel::Impl { std::stringstream sort_define_ss; std::vector field_list = {left_field_list_, right_field_list_}; - int idx = 0; for (auto relation_id : relation_id_) { auto relation_list_name = "sort_relation_" + std::to_string(relation_id) + "_"; diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_probe_kernel.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_probe_kernel.cc index 131fe471b..f6fb38450 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_probe_kernel.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/conditioned_probe_kernel.cc @@ -173,8 +173,6 @@ class ConditionedProbeKernel::Impl { std::shared_ptr* codegen_ctx_out, int* var_id) { auto codegen_ctx = std::make_shared(); - - std::vector prepare_list; bool cond_check = false; if (condition_) cond_check = true; @@ -191,7 +189,6 @@ class ConditionedProbeKernel::Impl { hash_prepare_ss << "RETURN_NOT_OK(typed_dependent_iter_list_" << hash_relation_id_ << "->Next(" << "&" << relation_list_name << "));" << std::endl; - hash_define_ss << "std::shared_ptr " << relation_list_name << ";" << std::endl; diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/hash_aggregate_kernel.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/hash_aggregate_kernel.cc index 53063c083..588ed9001 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/hash_aggregate_kernel.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/hash_aggregate_kernel.cc @@ -215,8 +215,6 @@ class HashAggregateKernel::Impl { std::shared_ptr* codegen_ctx_out, int* var_id) { auto codegen_ctx = std::make_shared(); - - std::vector prepare_list; // 1.0 prepare aggregate input expressions std::stringstream prepare_ss; @@ -240,7 +238,6 @@ class HashAggregateKernel::Impl { // 1. Get action list and action_prepare_project_list if (key_node_list.size() > 0 && key_node_list[0]->return_type()->id() == arrow::Type::DECIMAL128) { - aggr_prepare_ss << "aggr_hash_table_" << level << " = std::make_shared<" << GetTypeString(key_node_list[0]->return_type(), "") << "HashMap>(ctx_->memory_pool());" << std::endl; @@ -251,7 +248,6 @@ class HashAggregateKernel::Impl { } else if (key_node_list.size() > 1 || (key_node_list.size() > 0 && key_node_list[0]->return_type()->id() == arrow::Type::STRING)) { - aggr_prepare_ss << "aggr_hash_table_" << level << " = std::make_shared<" << GetTypeString(arrow::utf8(), "") << "HashMap>(ctx_->memory_pool());" << std::endl; @@ -305,7 +301,6 @@ class HashAggregateKernel::Impl { prepare_ss << "auto " << unsafe_row_name_validity << " = " << project_output_list[i].first.first << "_validity;" << std::endl; } else { - std::stringstream unsafe_row_define_ss; unsafe_row_define_ss << "std::shared_ptr " << unsafe_row_name << "_unsafe_row = std::make_shared(" diff --git a/native-sql-engine/cpp/src/precompile/wscgapi.hpp b/native-sql-engine/cpp/src/precompile/wscgapi.hpp index 003898963..970081fa2 100644 --- a/native-sql-engine/cpp/src/precompile/wscgapi.hpp +++ b/native-sql-engine/cpp/src/precompile/wscgapi.hpp @@ -1,33 +1,29 @@ #pragma once +#include #include #include -#include "codegen/arrow_compute/ext/code_generator_base.h" -#include "precompile/array.h" +#include +#include +#include +#include -#include "precompile/builder.h" -#include "utils/macros.h" +#include "codegen/arrow_compute/ext/actions_impl.h" #include "codegen/arrow_compute/ext/array_item_index.h" +#include "codegen/arrow_compute/ext/code_generator_base.h" #include "codegen/common/hash_relation.h" -#include "codegen/arrow_compute/ext/actions_impl.h" +#include "codegen/common/sort_relation.h" +#include "precompile/array.h" +#include "precompile/builder.h" +#include "precompile/gandiva.h" #include "precompile/hash_map.h" #include "precompile/sparse_hash_map.h" -#include "codegen/common/sort_relation.h" -#include "third_party/row_wise_memory/unsafe_row.h" - #include "precompile/type.h" +#include "third_party/row_wise_memory/unsafe_row.h" #include "third_party/ska_sort.hpp" #include "third_party/timsort.hpp" -#include "precompile/gandiva.h" - -#include - -#include -#include - -#include -#include +#include "utils/macros.h" using namespace sparkcolumnarplugin::precompile; using namespace sparkcolumnarplugin::codegen::arrowcompute::extra;