Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/exec/operator/memory_scratch_sink_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ Status MemoryScratchSinkOperatorX::sink_impl(RuntimeState* state, Block* input_b
{
SCOPED_TIMER(local_state._get_arrow_schema_timer);
// After expr executed, use recaculated schema as final schema
RETURN_IF_ERROR(get_arrow_schema_from_block(block, &block_arrow_schema, state->timezone()));
RETURN_IF_ERROR(get_arrow_schema_from_block(block, &block_arrow_schema, state->timezone(),
/*datetime_naive=*/true));
}
{
SCOPED_TIMER(local_state._convert_block_to_arrow_batch_timer);
Expand Down
5 changes: 3 additions & 2 deletions be/src/format/arrow/arrow_row_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ std::shared_ptr<arrow::Field> create_arrow_field_with_metadata(
}

Status get_arrow_schema_from_block(const Block& block, std::shared_ptr<arrow::Schema>* result,
const std::string& timezone) {
const std::string& timezone, bool datetime_naive) {
std::vector<std::shared_ptr<arrow::Field>> fields;
for (const auto& type_and_name : block) {
std::shared_ptr<arrow::DataType> arrow_type;
RETURN_IF_ERROR(convert_to_arrow_type(type_and_name.type, &arrow_type, timezone));
RETURN_IF_ERROR(
convert_to_arrow_type(type_and_name.type, &arrow_type, timezone, datetime_naive));
auto field = create_arrow_field_with_metadata(type_and_name.name, arrow_type,
type_and_name.type->is_nullable(),
type_and_name.type->get_primitive_type());
Expand Down
2 changes: 1 addition & 1 deletion be/src/format/arrow/arrow_row_batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::shared_ptr<arrow::Field> create_arrow_field_with_metadata(
bool is_nullable, PrimitiveType primitive_type);

Status get_arrow_schema_from_block(const Block& block, std::shared_ptr<arrow::Schema>* result,
const std::string& timezone);
const std::string& timezone, bool datetime_naive = false);

Status get_arrow_schema_from_expr_ctxs(const VExprContextSPtrs& output_vexpr_ctxs,
std::shared_ptr<arrow::Schema>* result,
Expand Down
Loading