From 343ea32b8f92d278e85c24e88d05544642c13dab Mon Sep 17 00:00:00 2001 From: Rui Mo Date: Fri, 25 Jun 2021 11:08:00 +0800 Subject: [PATCH] fix timestamp in native side (#373) --- .../codegen/arrow_compute/ext/whole_stage_codegen_kernel.cc | 3 ++- native-sql-engine/cpp/src/precompile/unsafe_array.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/whole_stage_codegen_kernel.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/whole_stage_codegen_kernel.cc index 9a9058e69..f781103e3 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/whole_stage_codegen_kernel.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/whole_stage_codegen_kernel.cc @@ -615,7 +615,8 @@ extern "C" void MakeCodeGen(arrow::compute::ExecContext *ctx, std::stringstream codes_ss; for (int i = 0; i < output_field_list.size(); i++) { auto data_type = output_field_list[i]->type(); - if (data_type->id() == arrow::Type::DECIMAL) { + if (data_type->id() == arrow::Type::DECIMAL || + data_type->id() == arrow::Type::TIMESTAMP) { codes_ss << "builder_" << i << "_ = std::make_shared<" << GetTypeString(data_type, "Builder") << ">(arrow::" << GetArrowTypeDefString(data_type) diff --git a/native-sql-engine/cpp/src/precompile/unsafe_array.cc b/native-sql-engine/cpp/src/precompile/unsafe_array.cc index 13685fb67..1620641c0 100644 --- a/native-sql-engine/cpp/src/precompile/unsafe_array.cc +++ b/native-sql-engine/cpp/src/precompile/unsafe_array.cc @@ -41,7 +41,8 @@ namespace precompile { PROCESS(arrow::Date32Type) \ PROCESS(arrow::Date64Type) \ PROCESS(arrow::StringType) \ - PROCESS(arrow::Decimal128Type) + PROCESS(arrow::Decimal128Type) \ + PROCESS(arrow::TimestampType) arrow::Status MakeUnsafeArray(std::shared_ptr type, int idx, const std::shared_ptr& in,