Skip to content

Commit

Permalink
fix array funcs which ret can be nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Nov 5, 2024
1 parent 3303c04 commit 997e9fc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion be/src/vec/functions/array/function_array_distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class FunctionArrayDistance : public IFunction {
// prepare return data
auto dst = ColumnFloat64::create(input_rows_count);
auto& dst_data = dst->get_data();
auto dst_null_column = ColumnUInt8::create(input_rows_count);
auto dst_null_column = ColumnUInt8::create(input_rows_count, 0);
auto& dst_null_data = dst_null_column->get_data();

const auto& offsets1 = *arr1.offsets_ptr;
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/functions/array/function_array_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class FunctionArrayElement : public IFunction {

Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
size_t result, size_t input_rows_count) const override {
auto dst_null_column = ColumnUInt8::create(input_rows_count);
auto dst_null_column = ColumnUInt8::create(input_rows_count, 0);
UInt8* dst_null_map = dst_null_column->get_data().data();
const UInt8* src_null_map = nullptr;
ColumnsWithTypeAndName args;
Expand Down
4 changes: 2 additions & 2 deletions be/src/vec/functions/array/function_array_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class FunctionArrayIndex : public IFunction {
const auto& right_chars = reinterpret_cast<const ColumnString&>(right_column).get_chars();

// prepare return data
auto dst = ColumnVector<ResultType>::create(offsets.size());
auto dst = ColumnVector<ResultType>::create(offsets.size(), 0);
auto& dst_data = dst->get_data();
auto dst_null_column = ColumnUInt8::create(offsets.size());
auto& dst_null_data = dst_null_column->get_data();
Expand Down Expand Up @@ -286,7 +286,7 @@ class FunctionArrayIndex : public IFunction {
const auto& right_data = reinterpret_cast<const RightColumnType&>(right_column).get_data();

// prepare return data
auto dst = ColumnVector<ResultType>::create(offsets.size());
auto dst = ColumnVector<ResultType>::create(offsets.size(), 0);
auto& dst_data = dst->get_data();
auto dst_null_column = ColumnUInt8::create(offsets.size());
auto& dst_null_data = dst_null_column->get_data();
Expand Down
Loading

0 comments on commit 997e9fc

Please sign in to comment.