Skip to content

Commit

Permalink
[Fix](thrift api) column should be converted if const before serializ…
Browse files Browse the repository at this point in the history
…e to arrow format (apache#26111)

```
select null;
```

The above sql from thrift api will cause crash in `write_column_to_arrow` since it's column const,
we should convert to full column
  • Loading branch information
eldenmoon authored Oct 30, 2023
1 parent 2a74d9a commit 619f2bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion be/src/util/arrow/block_convertor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,9 @@ Status FromBlockConverter::convert(std::shared_ptr<arrow::RecordBatch>* out) {
return to_doris_status(arrow_st);
}
_cur_builder = builder.get();
auto column = _cur_col->convert_to_full_column_if_const();
try {
_cur_type->get_serde()->write_column_to_arrow(*_cur_col, nullptr, _cur_builder,
_cur_type->get_serde()->write_column_to_arrow(*column, nullptr, _cur_builder,
_cur_start, _cur_start + _cur_rows);
} catch (std::exception& e) {
return Status::InternalError("Fail to convert block data to arrow data, error: {}",
Expand Down

0 comments on commit 619f2bb

Please sign in to comment.